Merge pull request #741 from whatdoineed2do/seekable-http-streams
Seekable http streams
This commit is contained in:
commit
31d852993f
|
@ -120,6 +120,15 @@ seek(struct input_source *source, int seek_ms)
|
||||||
return transcode_seek(source->input_ctx, seek_ms);
|
return transcode_seek(source->input_ctx, seek_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
seek_http(struct input_source *source, int seek_ms)
|
||||||
|
{
|
||||||
|
// stream is live/unknown length so obvs can't seek
|
||||||
|
if (source->len_ms == 0)
|
||||||
|
return -1;
|
||||||
|
return transcode_seek(source->input_ctx, seek_ms);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
metadata_get_http(struct input_metadata *metadata, struct input_source *source)
|
metadata_get_http(struct input_metadata *metadata, struct input_source *source)
|
||||||
{
|
{
|
||||||
|
@ -168,4 +177,5 @@ struct input_definition input_http =
|
||||||
.play = play,
|
.play = play,
|
||||||
.stop = stop,
|
.stop = stop,
|
||||||
.metadata_get = metadata_get_http,
|
.metadata_get = metadata_get_http,
|
||||||
|
.seek = seek_http
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,10 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
is_pause_allowed () {
|
is_pause_allowed () {
|
||||||
return this.$store.getters.now_playing && this.$store.getters.now_playing.data_kind !== 'url' && this.$store.getters.now_playing.data_kind !== 'pipe'
|
return this.$store.getters.now_playing &&
|
||||||
|
(this.$store.getters.now_playing.data_kind === 'file' ||
|
||||||
|
((this.$store.getters.now_playing.data_kind === 'url' && this.$store.state.player.item_length_ms !== 0) && this.$store.getters.now_playing.data_kind !== 'pipe')
|
||||||
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue