New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use with array playlist as input? #42
Comments
Hi @pietrop Yeah, absolutely this is possible! I've added a static utility function called The descriptions for the clips is in the same format as the html5-video-compositor. It can be used like the following: <!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="../dist/videocontext.js"></script>
</head>
<body>
<p>
<canvas id="canvas" width="480", height="320"></canvas>
</p>
<button id="play-button">Play</button>
<button id="pause-button">Pause</button>
<script type="text/javascript">
window.onload = function(){
var canvas = document.getElementById("canvas");
var ctx = new VideoContext(canvas);
var playlist = [
{type:"video", sourceStart:0, start:0, duration:5, src:"video1.mp4"},
{type:"video", sourceStart:0, start:5, duration:5, src:"video2.mp4"},
{type:"video", sourceStart:10, start:10, duration:5, src:"video3.mp4"}
];
var videoTrack = VideoContext.importSimpleEDL(ctx, playlist);
// Connect the created track to the ouput canvas so it can be rendered.
// You could also connect the video track to an effect node if you wanted to do effects.
videoTrack.connect(ctx.destination);
var playButton = document.getElementById("play-button");
var pauseButton = document.getElementById("pause-button");
playButton.onclick = function(){ ctx.play(); };
pauseButton.onclick = function(){ ctx.pause(); };
};
</script>
</body>
</html> The The VideoContext in general has a bunch of advantages over the old html5-video-compositor such as better support on mobile, better resource management, support for doing transitions between clips, more effects. The downside is it's a bit more complicated to use as it provides a lower level interface, but in general you should be able to do everything that the html5-video-compositor could do and more. Let me know if you have any other questions! |
This is more of a question and less of an issue, but I'd been using the node deprecated
BBC HTML5 Video Compositor
, and I really liked the possibility of being able to pass in a playlist that consisted of an array of clips, as an EDL of some sort.Is there a way to do the same in
VideoContext
?The text was updated successfully, but these errors were encountered: