<script>
var canvas, stage, exportRoot;
function init() {
canvas = document.getElementById("canvas");
exportRoot = new lib.yes();
stage = new createjs.Stage(canvas);
stage.addChild(exportRoot);
var videoDom = $('<video width="320" height="240" autoplay><source src="movie.mp4" type="video/mp4"></video>').appendTo(document.body)[0];
var cjsVideo = new createjs.DOMElement(videoDom);
stage.addChild(cjsVideo);
stage.update();
createjs.Ticker.setFPS(24);
createjs.Ticker.addEventListener("tick", stage);
}
</script>
答案 0 :(得分:1)
最后我找到了答案,你可以在没有jquery / js的情况下在createjs canvas中加载视频
只需将代码粘贴到flash cc
中即可/* js
video = document.createElement(‘video’);
video.src = ‘http://graphicscoder.org/video/small.mp4’;
video.autoplay =true;
video.controls=true;
video.volume = 0;
var Video = new createjs.Bitmap(video);
stage.addChild(Video);
*/
获取来源:http://graphicscoder.org/my-createjs/load-video-in-canvas-createjs/