Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

HLS Stream on Android


I have an HLS stream coming from Wowza. I know it works on Android because when I go directly to the URL in the browser on my phone it plays in the native video player in Chrome. However, JW Player throws a no playable sources error. I know the stream works on my device but JW Player won't play it. Any help?

11 Community Answers

JW Player

User  
-1 rated :

I have the exact same problem. I have to detect if its android using PHP and display a HREF link with the HLS inside for Android devices...

My live HLS stream works fine on Android but JWP6 cannot work with it on Android. Please help.

Ethan Feldman

JW Player Support Agent  
0 rated :

There are issues with Android + html5 <video> – http://www.jwplayer.com/blog/the-pain-of-live-streaming-on-android/

JW Player

User  
0 rated :

Fred that's what I have to do as well. I have a combo of PHP and javascript to determine Android and then which version. Anything below 4.0 gets an RTSP stream and anything 4.0 and above gets HLS.

Ethan, that article doesn't really answer my question and it's also a bit wrong.

" To be fair, its not all Androids fault for lacking support for HLS in version 4.2 and beyond."

I'm testing HLS streams on Android 4.4.2 and they work fine using the video tag. That's why I'm confused. The stream works perfectly fine and is supported, just not by JW Player. Does JW Player even attempt to play the stream or does it detect Android and just automatically throw the error? If it's working using a video tag shouldn't JW Player be able to play it?

JW Player

User  
0 rated :

Ethan, a simple workaround would be for all android devices to redirect to the HLS stream without loading anything else... at least it would prevent us to do that with PHP. Or when you click the play icon in the middle of the player it would link direct to the HLS.

Ethan Feldman

JW Player Support Agent  
0 rated :

One idea is to detect the android useragent.

Here is a work around:

<!DOCTYPE html>
<script src="http://p.jwpcdn.com/6/8/jwplayer.js"></script>
<center><div id='container'></div></center>
<script>
if (navigator.userAgent.match(/android/i) != null){
	jwplayer("container").setup({
		file: "http://playertest.longtailvideo.com/adaptive/bbbfull/bbbfull.m3u8",
		type: "mp4",
		primary: "html5"
	});
} else {
jwplayer("container").setup({
  playlist: [{
    image: "http://content.bitsontherun.com/thumbs/gSzpo2wh-480.jpg",
    sources: [{
      file: "http://content.jwplatform.com/manifests/s8BPzDe0.smil"
    },{
      file: "http://playertest.longtailvideo.com/adaptive/bbbfull/bbbfull.m3u8"
    }]
  }],
  primary: "flash"
});
}
</script>

JW Player

User  
0 rated :

That works but when I tap the play button it acts like a link. The stream opens up in full screen in the browser and shows the Wowza URL in the address bar. It doesn't look like JW Player is actually playing it.

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes, but it is better than nothing.

JW Player

User  
0 rated :

I mean it's better than nothing but it's kind of a bummer. It doesn't seem like the player even attempts to play the stream. It just detects Android and automatically assumes it can't play it. Hopefully this is something that can be addressed.

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes, once newer androids have a higher market share we will add it back.

JW Player

User  
0 rated :

Is there any way to implement a version detection in the player so that if it's 4.0 and up the m3u8 stream is playable? I found this script somewhere and it works pretty well for me...

bc.. var ua = navigator.userAgent;
if( ua.indexOf("Android") >= 0 ) {
var androidversion = parseFloat(ua.slice(ua.indexOf("Android")+8));
if (androidversion < 4.0) {
do something here
} else {
do something else here
}
}

Ethan Feldman

JW Player Support Agent  
-1 rated :

You could use that script to do something, like show the m3u8 directly, or rtsp for older androids. We are not going to add this into the player just yet though.

This question has received the maximum number of answers.