can we play the content not from the start in hls

2019-08-15 06:46发布

问题:

I have a hls playlist playlist.m3u8 file where the url's of all the chunks are there.

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:11
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10,
01-0.ts
#EXTINF:10,
01-1.ts
#EXTINF:10,
01-2.ts
#EXTINF:10,
01-3.ts
#EXTINF:10,
01-4.ts
#EXTINF:10,
01-5.ts
#EXTINF:10,
01-6.ts
#EXTINF:10,
01-7.ts

Even if I change the media sequence no to , say 5, it always plays from the start. Is there anyway that I can play the content from any given point i.e not always from the start ? Please help me.

回答1:

If you want to keep all the segments in the playlist you can use the optional tag #EXT-X-START:TIME-OFFSET=<seconds>. This is available in version 6 of the protocol.

Source: https://tools.ietf.org/html/draft-pantos-http-live-streaming-12#section-3.4.16