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

Streaming on Android


Does anyone know how I can make this JWPlayer 6 setup work on Android as well? Thanks


jwplayer("player").setup({
playlist: [{
image: "/images/still.jpg",
sources: [{
file: "rtmp://live.domain.com:1935/live/mp4:my.sdp"
},{
file: "http://live.domain.com:1935/live/_definst_/my.sdp/playlist.m3u8"
}]


}],
rtmp: {
bufferlength: 6
},
height: 480,
primary: "flash",
width: 854

});

10 Community Answers

Ethan Feldman

JW Player Support Agent  
1 rated :

Android has some issues with m3u8 natively.

I would read over this – http://www.longtailvideo.com/support/jw-player/28856/using-apple-hls-streaming, there is a work around mentioned here.

Also this blog post – http://www.longtailvideo.com/blog/31646/the-pain-of-live-streaming-on-android

JW Player

User  
1 rated :

Thanks for the links, but they are pretty vague when it comes down to the .mp4 fallback. Does this mean that they can't grab a live stream, and can only grab pre-recorded video? By adding the mp4:mmi.sdp in front of my second file. would is work by making the fallback say this:

file: "rtmp://live.domain.com:1935/live/mmi.mp4"

how do I get a live stream into an mp4 using wowza and wirecast with the jwplayer?
//////////////////////////////////////////////////////////////
jwplayer("player").setup({
playlist: [{
image: "/images/still.jpg",
sources: [{
file: "http://live.domain.com:1935/live/_definst_/mmi.sdp/playlist.m3u8"
},{
file: "rtmp://live.domain.com:1935/live/mp4:mmi.sdp"
}]


}],
rtmp: {
bufferlength: 6
},
height: 480,
primary: "flash",
width: 854

});

Ethan Feldman

JW Player Support Agent  
-1 rated :

Np.

I would recommend doing rtmp as the 1st source, then m3u8 as the 2nd source. Then set primary to flash, then set fallback to false, then set up an rtsp url outside of the player setup entirely, to cover android, ios, and desktops alike. A bit messy, I know, but that should work.

JW Player

User  
0 rated :

So you are suggesting this? This still functions on desktop, and it changes the player to "loading the player", rather than "no playable sources found" on Android. I am assuming it is something with the last line that is wrong that is breaking it now, but at least it's trying. I set the ending to mmi.mp4, but that didn't work either.


<script type="text/javascript">

jwplayer("player").setup({
playlist: [{
image: "/images/still.jpg",
sources: [{
file: "rtmp://live.domain.com:1935/live/mp4:mmi.sdp"
},{
file: "http://live.domain.com:1935/live/_definst_/mmi.sdp/playlist.m3u8"
}]


}],
rtmp: {
bufferlength: 6
},
height: 480,
primary: "flash",
width: 854,
fallback: false

});


file: "rtsp://live.domain.com:1935/live/mp4:mmi.sdp"

</script>

JW Player

User  
-1 rated :

Looking at the HLS Live on Android section on this page:

http://www.longtailvideo.com/support/jw-player/28856/using-apple-hls-streaming

What I'm wondering is if I can do a live stream to android? On the page I do a call to see if there is an .sdp stream, and if there is, it goes to a live stream player. if there isn't it loads a player with a library of pre-recorded vids in the sidebar to view. I can get my mp4 library to play on Android when I'm not streaming, but I'm wondering if there is anyway to get it to play an .sdp or any other type of non pre-recorded video?

Thanks for the help!

Josh

Ethan Feldman

JW Player Support Agent  
-1 rated :

Yes, you can, but it has to be either rtsp or pre recorded mp4.

And in your code, I meant that this line should not be in the player set up.

file: “rtsp://live.domain.com:1935/live/mp4:mmi.sdp”

It would be outside of the player set up entirely, like:

<a href="rtsp://live.domain.com:1935/live/mp4:mmi.sdp">Play this on Android</a>

As per the work around on – http://www.longtailvideo.com/support/jw-player/28856/using-apple-hls-streaming explains

JW Player

User  
0 rated :

That kinda sucks, but it works. Thanks!

Ethan Feldman

JW Player Support Agent  
-1 rated :

Np! Agreed.

JW Player

User  
-2 rated :

A nice way to do this is to place the link to Android in the div above the player. That way it only shows when the player doesn't load. As in:

bc.. <div id="myElement">
<a href="rtsp://_STREAM_file.mp4">Play this on Android</a>
</div>

Ethan Feldman

JW Player Support Agent  
-2 rated :

Yeah.

This question has received the maximum number of answers.