I'm trying to use JWPlayer as a way around Android not supporting HLS playback in Webview in Phonegap (or ar least I can't get it to work, only with WebM streams and the video plugin on https://github.com/macdonst/VideoPlayer , HLS streams give audio only )
I know the user needs flash installed but at the moment what's most importart for me is to get either the RTMP or HLS (.m3u8) displayed on the device (2.3, 4.0 or 4.1, whichever works!)
However I keep getting the "Error loading player: no playable sources found" error when implementing the JWplayer in android. So far I have only tested in the simulator.
The code is nothing fancy, in the HTML file after including cordova JS all I do is:
<script type="text/javascript" src="jwplayer/jwplayer.js" ></script>
<script type="text/javascript">jwplayer.key="b+mykey"</script>
<div id="my-video"></div>
<script type="text/javascript">
jwplayer('my-video').setup({
flashplayer: "javascripts/lib/jwplayer/player.swf",
streamer: "rtmp://myserveraddressgoeshere",
file: "corecctfile.goeshere-sdh",
provider:"rtmp",
autostart: 'true',
controlbar: "over",
width: '720',
height: '405'
});</script>
Obviously I have the correct paths but obscured them here for client privacy reasons.
Does anyone have an idea as to why this does not work? Or how I can get the RTMP / HLS stream to work on an Android device?
As mentioned the application is a PhoneGap application.
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…