JWPlayer在wowza中仅使用我的smil文件显示Apple HLS

时间:2016-01-06 15:10:07

标签: jwplayer rtmp wowza hls smil

我正在使用wowza流引擎和jw播放器来显示流和正常工作。但我想控制视频的比特率,以便用户可以在没有太多缓冲的情况下看到视频。 所以我在stackoverflow中搜索并找到以下链接。 why smil file is not working with rtmp both in wowza and jwplayer

我正在使用JWplayer pro 6.0.2813和wowza 4.3

这是我的test.smil文件

<smil>
<head>
</head>
<body>
    <switch>
    <video src='mp4:test_49152.mp4' system-bitrate='49152' title='192x108'/>
    <video src='mp4:test_114688.mp4' system-bitrate='114688' title='256x144'/>
    <video src='mp4:test_184320.mp4' system-bitrate='184320' title='320x180'/>
    <video src='mp4:test_339968.mp4' system-bitrate='339968' title='480x270'/>
    <video src='mp4:test_544768.mp4' system-bitrate='544768' title='640x360'/>
    <video src='mp4:test_987136.mp4' system-bitrate='987136' title='854x480'/>
    </switch>
</body>
</smil>

和我的js代码:

var playerInstance = jwplayer("myElement");
playerInstance.setup({
    type: 'smil',
    playlist: [{
        image: "/images/myPoster.jpg",
        sources: [{
            file: "http://173.244.173.196:1935/vod/smil:test.smil/manifest.mpd"
        },{
            file: "rtmp://173.244.173.196:1935/vod/smil:test.smil" //Adobe RTMP . not work
        },{
            file: "http://173.244.173.196:1935/vod/smil:test.smil/jwplayer.smil" //Adobe RTMP . not work
        },{
            file: "http://173.244.173.196:1935/vod/smil:test.smil/manifest.f4m"
        },{
            file: "rtsp://173.244.173.196:1935/vod/smil:test.smil"
        },{
            file: "http://173.244.173.196:1935/vod/smil:test.smil/playlist.m3u8" //this work fine!
        }]
    }],

    width: '100%',
    aspectratio: "16:9",
    primary: "flash",
    stretching: "uniform"
});

它在Apple设备上完全正常工作,但在 android 桌面浏览器中显示黑屏

1 个答案:

答案 0 :(得分:5)

我意识到type: 'smil'属于另一个版本,不需要添加它。 用这个:

playerInstance.setup({
    playlist: [{
    image: "/images/myPoster.jpg",
    sources: [{
        file: "http://173.244.173.196:1935/vod/smil:test.smil/playlist.m3u8"
    },{
        file: "http://173.244.173.196:1935/vod/smil:test.smil/jwplayer.smil"
    },{
        file: "rtsp://173.244.173.196:1935/vod/test.mp4"
    }]
    }],
    width: '100%',
    aspectratio: "16:9",//Common values are 16:9, 24:10 or 4:3
    primary: "flash",
    stretching: "uniform"//stretching (uniform,fill,exactfit,none)
});

如果您对改进的配置有任何了解,请告诉我