3

I am trying to play .m3u8 video file. Format of video file is like this:

#EXTM3U
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:5, VIDEO-1
https://xxx.com/0070fd659f6094bf285e58863cf6bc32-VIDEO-1.ts
#EXTINF:5, VIDEO-2
https://xxx.com/0070fd659f6094bf285e58863cf6bc32-VIDEO-2.ts
#EXTINF:5, VIDEO-3
https://xxx.com/0070fd659f6094bf285e58863cf6bc32-VIDEO-3.ts
#EXT-X-ENDLIST

When i play this file in iOS native player, then it skips first 5 second video and directly starts from 6th second. But when i run it in VLC or android then it works fine. Based on the HLS spec, the target duration should be the maximum duration of each file, so 5 is correct.

I tried to edit the file manually and duplicated first video urls then it works full file.

#EXTM3U
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:5, VIDEO-1
https://xxx.com/0070fd659f6094bf285e58863cf6bc32-VIDEO-1.ts
#EXTINF:5, VIDEO-2
https://xxx.com/0070fd659f6094bf285e58863cf6bc32-VIDEO-1.ts
#EXTINF:5, VIDEO-3
https://xxx.com/0070fd659f6094bf285e58863cf6bc32-VIDEO-1.ts
#EXTINF:5, VIDEO-4
https://xxx.com/0070fd659f6094bf285e58863cf6bc32-VIDEO-2.ts
#EXTINF:5, VIDEO-5
https://xxx.com/0070fd659f6094bf285e58863cf6bc32-VIDEO-3.ts
#EXT-X-ENDLIST

Is there any specific thing why original file didn't work properly in iOS? Can we make it somehow work over device?

This is m3u8 coming from server so anything specific we need to change over server?

Adeesh Jain
  • 645
  • 10
  • 22

0 Answers0