Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
731 views
in Technique[技术] by (71.8m points)

ios - Http Live Streaming for iPhone and why we use .m3u8 file

I have done all that from This I have also made .ts and m3u8 file. In local server and live server i can play mp4 file like

 <video width="320" height="240" controls="controls" autoplay="autoplay">
 <source src="movie.mp4" type="video/mp4" />
 </object>
 </video>

But i have problem with playing .m3u8 file

 <video width="320" height="240" controls="controls" autoplay="autoplay">
 <source src="movie.m3u8" type="video/m3u8" />
 </object>
 </video>

My mediafilesegmenter created two .ts file and one .m3u8 . My m3u8 file is

 #EXTM3U
 #EXT-X-TARGETDURATION:10
 #EXT-X-VERSION:4
 #EXT-X-MEDIA-SEQUENCE:0
 #EXT-X-PLAYLIST-TYPE:VOD
 #EXT-X-I-FRAMES-ONLY
 #EXTINF:1.0117,    
 #EXT-X-BYTERANGE:8084@376
 fileSequence0.ts
 #EXTINF:1.0117,    
 #EXT-X-BYTERANGE:7332@36096   and so on....

So is there any problem in mime.types because i wrote all the confusions in mime.types see like -

 application/x-mpegURL                          m3u8
 video/MP2T                                     ts

 AddType appliction/x-mpegURL                   m3u8
 AddType video/MP2T                             ts

 #application/x-mpegURL                          m3u8
 #video/MP2T                                     ts

 application/x-mpegURL.m3u8
 video/MP2T.ts

 #application/x-mpegURL.m3u8
 #video/MP2T.ts

 #AddType application/x-mpegURL                   m3u8
 #AddType video/MP2T                             ts

 #AddType application/x-mpegURL.m3u8
 #AddType video/MP2T.ts

 AddType application/x-mpegURL.m3u8
 AddType video/MP2T.ts

I can't play .m3u8 file in VLC and got that error Link

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As long as your conf is

AddType application/x-mpegURL .m3u8
AddType video/MP2T .ts

it should work for apache. I'm not sure if it's your .ts or .m3u8 problem, so I suggest the following:

  • Download example .ts and .m3u8 file from Apple and test them on your server
  • check if there is empty lines in the index file, as this question

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...