如何使用VideoJS flash后备进行RTMP流媒体?

时间:2012-11-27 06:05:13

标签: javascript flash video-streaming rtmp video.js

我想设置VideoJS来处理使用VideoJS-SWF播放器作为flash-fallback的RTMP流,这似乎有一些支持。

这就是我为普通MP4视频设置VideoJS的方法:

var tag = document.createElement("video");
tag.id = "vid1";
tag.controls = true;
tag.className = "video-js";
tag.preload = "auto";
tag.width = "640";
tag.height = "264";
tag.poster = "http://video-js.zencoder.com/oceans-clip.png";

var source1 = document.createElement("source");
source1.src = "http://video-js.zencoder.com/oceans-clip.mp4";
source1.type = "video/mp4";
tag.appendChild(source1);

// Add more sources, etc...

document.getElementById('player').appendChild(tag);

var player = _V_(tag, {width:640, height:264, techOrder:['flash', 'html5']}, function() {
    var that = this;
    this.addEvent('loadstart', function { that.play(); });
});

但是如何设置VideoJS来播放RTMP流?您是否使用相同的标签,或者是否有其他方式来指定RTMP提供商和流网址?

1 个答案:

答案 0 :(得分:0)

仅供参考 - VideoJS尚未提供RTMP流媒体,但最近的更改(如https://github.com/videojs/video.js/pull/605)表示可能很快就会出现。

请注意https://github.com/videojs/video.js/issues/559处的功能请求以获取更新。

相关问题