How to play .m3u8 Stream Using jwplayer on an Android phone?

I use phonegap to stream http live. I use jwplayer for it.

here is the code for it.

<div id='mediaplayer1'> <script type="text/javascript"> jwplayer('mediaplayer1').setup({ 'id': 'playerID', 'width': '388', 'height': '218', 'provider': 'rtmp', 'streamer': 'rtmp://myserver/chk', 'autostart': 'true', 'stretching': 'exactfit', levels: [{ bitrate: "800", file: "file-super", width: "1280" }], 'modes': [ {type: 'flash', src: 'http://www.myserver.com/jwplayer/player.swf'}, { type: 'html5', config: { levels: [ {'file': 'http://myserver/playlist.m3u8'} ], 'provider': 'video' } } ] });</script> </div> 

and in the head

 <script src="jwplayer.js" type="text/javascript"></script> 

I want to play .m3u8 url. play the video several times in about 1 or 2 seconds. and automatically stops. and several times show a warning that the resource available for the game was not found. how to solve it. is there a good example / tutorial for it.

Thanks in advance.

+4
source share
2 answers

Use the Vitamio Player it can play all kinds of streaming also open source. You just need to include this as a library in ur project and don't forget to use vitamio videoview or mediaplayer. k do not worry, see Example to include Vitamio project in ur

Hope this helps you,

0
source

Simply streaming video can be opened in a child browser or in the application browser for playing video. This solution will work on both Android and iOS.

Also, if streaming is opened in the browser, it will appear in full screen mode, as the q media player will play the video on safari.

Hope this helps.

0
source

Source: https://habr.com/ru/post/1483325/


All Articles