在运行时(iOS)动态更改m3u8文件

在运行时(iOS)动态更改m3u8文件,ios,http-live-streaming,Ios,Http Live Streaming,有人知道我是否可以在应用程序运行时动态更改m3u8文件吗 情况如下: 假设我有多个.ts文件可以按顺序播放,例如1.ts、2.ts、3.ts等 现在在运行时,我想将顺序更改为1.ts、3.ts,然后再更改为2.ts 这可能吗 谢谢,答案见(2017年8月): 服务器不得更改媒体播放列表文件,除非: o Append lines to it (Section 6.2.1). o Remove Media Segment URIs from the Playlist in the order

有人知道我是否可以在应用程序运行时动态更改m3u8文件吗

情况如下: 假设我有多个.ts文件可以按顺序播放,例如1.ts、2.ts、3.ts等

现在在运行时,我想将顺序更改为1.ts、3.ts,然后再更改为2.ts

这可能吗

谢谢,

答案见(2017年8月):

服务器不得更改媒体播放列表文件,除非:

o  Append lines to it (Section 6.2.1).

o  Remove Media Segment URIs from the Playlist in the order that they
 appear, along with any tags that apply only to those segments
 (Section 6.2.2).

o  Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X-
 DISCONTINUITY-SEQUENCE tags (Section 6.2.2).

o  Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1).
注:原始答案的(大约2012年)略有不同:

服务器不得更改播放列表文件,除非:

o  Append lines to it (Section 6.2.1).

o  Remove Media Segment URIs from the Playlist in the order that they
 appear, along with any tags that apply only to those segments
 (Section 6.2.2).

o  Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X-
 DISCONTINUITY-SEQUENCE tags (Section 6.2.2).

o  Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1).
附加行(第6.2.1节)

按媒体URI出现的顺序从播放列表中删除媒体URI, 以及仅适用于这些媒体URI的任何标记 (第6.2.2节)

增加EXT-X-MEDIA-SEQUENCE标记的值 (第6.2.2节)

添加或删除EXT-X-STREAM-INF标记或EXT-X-I-FRAME-STREAM-INF 标签(第6.2.4节)。请注意,不要求客户机 重新加载变体播放列表文件,因此更改它们可能不会导致 立即生效

将EXT-X-ENDLIST标签添加到播放列表(第6.2.1节)

总而言之,协议不支持您的目标


无论如何,这是毫无意义的,因为片段之间可能按顺序相互关联(具有公共关键帧)。

@Daniel Bauke这里是对您(正确)答案的更新。我的目的只是提供更新的指针。结果看起来像是一个新的答案,但事实并非如此!顺便说一句,谢谢你的原始答案。