Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

video on demand streamin with jwplayer wowza android issue

Tags:

jwplayer

wowza

I try to make jwplayer work on android phone when I put rtsp protocol file source it work fine in android but display an error that file can not be played in iOS and PC

without rtsp file source work on pc and iOS fine with rtsp file source work only in android

jwplayer("mediaplayer").setup({
            playlist: [{
                sources: [
                        {file:'rtmp://localhost:1935/vod/mp4:dexter.mp4'}//used it to PC ,
                        {file:'rtsp://localhost:1935/dexter/dexter.mp4'}// used it to android,
                        {file:'http://localhost:1935/vod/mp4:dexter.mp4/playlist.m3u8'}//and this for iOS                       
                        ],
                title: 'dexter',

        width: 854,
        height: 480,
    });
like image 854
Taymoor Q. Avatar asked Jul 10 '13 11:07

Taymoor Q.


1 Answers

I have Solved the issue by checking if the device is android or not

 var ua = navigator.userAgent.toLowerCase();
    var isAndroid = ua.indexOf("android") > -1;
    jwplayer("mediaplayer").setup({
        playlist: [{
            sources: [
                    (isAndroid)?{file:'rtsp://localhost:1935/vod/dexter/dexter.mp4'}:{file:'rtmp://localhost:1935/vod/mp4:dexter/dexter.mp4'},
                    {file:'http://localhost:1935/vod/mp4:dexter.mp4/playlist.m3u8'}                     
                    ],
    title: 'dexter',
    width: 854,
    height: 480,
});
like image 192
Taymoor Q. Avatar answered Sep 28 '22 00:09

Taymoor Q.