我正在使用wowza流引擎和jw播放器来显示流和工作正常.但我想控制视频的比特率,以便用户可以在没有太多缓冲的情况下看到视频.所以我在stackoverflow中搜索并找到以下链接. 为什么smil文件在wowza和jwplayer中都不能与rtmp一起使用
我正在使用JWplayer pro 6.0.2813和wowza 4.3
这是我的test.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和桌面浏览器中显示黑屏.
我意识到这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) });
如果您对改进配置有任何想法,请告诉我.