视频点播流与jwplayer wowza android问题 [英] video on demand streamin with jwplayer wowza android issue

查看:106
本文介绍了视频点播流与jwplayer wowza android问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将rtsp协议文件源放到jwplayer上时,我尝试使其在android手机上工作,但在android上却能正常工作,但显示错误,表明文件无法在iOS和PC上播放

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

在PC和iOS上无需rtsp文件源即可正常工作 rtsp文件源只能在android

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,
    });

推荐答案

我已经通过检查设备是否为android解决了该问题

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,
});

这篇关于视频点播流与jwplayer wowza android问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆