Reputation: 105
probably a favourite question but I haven't found any answer
How can I play live stream on Android devices?
Is there some free solution?
I think that premium version JWplayer support this but not the free one.
I'm using CDNsun via JSONP which returns me a lot of protocols like that
MyCallBack({
“rtmp”: “rtmp://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4”,
“rtmpe”: “rtmp://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4”,
“apple”: “http://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4/playlist.m3u8”,
“adobe”: “http://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4/manifest.f4m”,
“rtsp”: “rtsp://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4”,
“silverlight”: “http://51993226.e.62239915.r.cdnsun.net/62239915/62239915/myvideo.mp4/Manifest”
});
I have tried all of them (starting with RTSP) but with no success, The stream is OK on PC but Android sucks :(
Thank you
Upvotes: 1
Views: 1388
Reputation: 4201
I came up with a nasty work around for this. It isn't the prettiest thing, but it will end up launching the stream using the native Android media player.
You can use the below code to test this 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>
This plays RTMP on the desktop, HLS on iOS, and has a fallback for Android to also play the m3u8 in the default Android media player.
Upvotes: 0
Reputation: 885
There is no option to stream video in android with jwplayer. Read more here: http://www.jwplayer.com/blog/the-pain-of-live-streaming-on-android/
Upvotes: 1