
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>