Merge pull request #741 from whatdoineed2do/seekable-http-streams

Seekable http streams
This commit is contained in:
ejurgensen 2019-05-16 15:26:32 +02:00 committed by GitHub
commit 31d852993f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -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
}; };

View File

@ -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')
)
} }
}, },