3
votes

I want to set up VideoJS to handle RTMP streaming using VideoJS-SWF player as flash-fallback, which does seem to have some support for it.

This is how I'd set up VideoJS for normal MP4 videos:

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

But how do you set up VideoJS to play an RTMP stream? Do you use the same tags, or is there some other way to specify the RTMP provider and stream url?

1
I'm curious as to how you know that the RTMP stream is not being used?Lachlan McD.

1 Answers

1
votes

Just FYI - RTMP streaming is not yet available in VideoJS, but recent changes (like https://github.com/videojs/video.js/pull/605) indicate that it may be soon.

Pay attention to the feature request at https://github.com/videojs/video.js/issues/559 for updates.