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

RTSP redirection fails


If check for device platform and in case of android redirect the page automatically to the RTSP address it fails


"This webpage is not available"


but the same code if I click back will play, of if place the same link in an "<a>" tag, and click on it, it will work


<html>
<head>
<title>JW Player</title>

<script type="text/javascript" src="http://jwpsrv.com/library/aQtlHvBVEeO6eyIACyaB8g.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">jwplayer.key="[My JP key]";</script>

<script type="text/javascript">
$(window).load(function(){
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
var isWindows = ua.indexOf("windows") > -1;
if(isAndroid){
window.location.replace("rtsp://[server-ip]:554/MyVOD/FSRmedium")
}

});
</script>
</head>

<body>
<div id="player"></div>
<script type="text/javascript">
jwplayer("player").setup({
sources: [{
file: "rtmp://[server-ip]:1935/MyVOD/mp4:sample.mp4"
},{
file: "http://[server-ip]:1935/MyVOD/mp4:sample.mp4/playlist.m3u8"
}],
rtmp: {
bufferlength: 3
},
fallback: false
});
</script>
</body>
</html>


if remove the script from the head, and replace the player dive line with this, it will work:

<div id="player"><a href="rtsp://[server-ip]:554/MyVOD/FSRmedium">RTSP LINK</a></div>

5 Community Answers

Andrew

JW Player Support Agent  
0 rated :

It is possible to use HLS with Android now by setting androidhls: true within the embed. Unfortunately, I’m not sure why the redirection is failing, but it may be related to how Android browsers handle RTSP redirects.

Also, Android devices are capable of playing M3U8 files directly downloaded on 4.0+ devices, similar to RTSP. Is this something that you’d be interested in using as well?

ali

User  
0 rated :

Thanks Andrew for your reply, yea I could use HLS on android (which I am using), but then again it will only work on 4.0 onward, on previous versions it's problematic and on older versions it doesn't work at all.

ali

User  
0 rated :

What's funny is that even andriodhls: true, doesn't work if i self-host the jwplayer.js, even it's the same file as the one hosted by you, you have any idea?

Andrew

JW Player Support Agent  
0 rated :

Is it possible to put this setup on a live page for me to look at? It might be helpful to see these issues firsthand with a demo.

ali

User  
0 rated :

sorry i was on CNY holidays n just came back, give me today, I will create n post it.

This question has received the maximum number of answers.