最简单的方法在CreateJS中加载视频? [英] Easiest way to load a video in CreateJS?

查看:1447
本文介绍了最简单的方法在CreateJS中加载视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过CreateJS(Flash CC)加载视频,格式为mp4或ogg。最简单的方法是什么?几乎没有文档。我知道视频可以上传为位图,例如:

I'm looking to load a video via CreateJS (Flash CC), either mp4 or ogg format. What is the easiest way to do this? There is almost no documentation out there. I know videos can be uploaded as a bitmap, eg:

 var bitmap = new createjs.Bitmap("moviePath.mp4");

当我以这种方式加载视频时,我可以听到音频播放,看到画布上的视频。我怀疑这是因为画布不是绘制每个单独的框架,尽管使用ticker函数和stage.update()

When I load a video in this way, I can hear the audio playing, but can't actually see the video on the canvas. I suspect this is because the canvas isn't drawing each individual frame, despite putting ticker functions and stage.update()

任何帮助是赞赏!

推荐答案

我认为你应该使用 DOMelement 。假设你使用jQuery,你可以尝试这样的:

I think you should use the DOMelement for this. Assuming you're using jQuery you could try something like this:

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

这篇关于最简单的方法在CreateJS中加载视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆