4

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!

Ayame__
  • 980
  • 2
  • 9
  • 21

1 Answers1

6

JW Player does not support Flash on Android anymore, as a response to Adobe also dropping Android Flash support. Only HTML5 (and therefore only MP4/WebM) are supported, as of Android 2.3.

HTTP Live Streaming indeed has limited support for HTML5 in Android. It's only playing in 4.0+ and has a few critical bugs: display aspect ratios are not recognised and on-demand HLS streams act like live ones (no timeline; no seeking).

The best solution to streaming on Android is leveraging an SDK that supports HLS for your native app. Several companies offer such an SDK (e.g. devicedrm.com or nexstreaming.com). I don't know whether such solutions would work with Phonegap though.

JeroenW
  • 191
  • 4
  • 2
    I just want to add, HTTP Live Streaming was introduced in Android 4.0 but dropped in 4.1. [Reference - The state of HTML5 Video](http://www.longtailvideo.com/html5/) – James Wong Mar 21 '13 at 09:50