FIVe3DでVideoを扱う

FIVe3Dを使えばVideo3Dクラスで動画も簡単に扱えます。

private function video3d():void {
	var scene:Scene3D = new Scene3D();
	scene.x = stage.stageWidth >> 1;
	scene.y = stage.stageHeight >> 1;
	addChild(scene);
 
	container = new Sprite3D();
	scene.addChild(container)
 
	video = new Video3D();
	video.x -= 160;
	video.y -= 120;
	container.addChild(video);
 
	nc = new NetConnection();
	nc.connect(null);
	ns = new NetStream(nc);
	ns.client = {};
	ns.play("video.flv");
	video.attachNetStream(ns);
	video.activate();
}

ハマったのがvideo.activate();の部分です。

動画の音声は流れても映像は出ないという問題にぶつかりVideo3D.asの中身を見ると見慣れない関数がありました。
・activate
・desactivate

activateをたたくと毎フレームbitmapdata.draw()でキャプチャすることで映像も表示するようになり、逆に毎フレーム処理をdesactivateで停止する事も出来るようです。

This movie requires Flash Player 9

ほんとFIVe3Dの使い安くて便利です!

Filed under AS3, FIVe3D · Tagged with , ,

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.