var videomat:VideoMaterial = new VideoMaterial({loop:true,
file:"videos/verycoolvid.flv"});
_video = videomat.video;
Fabrice
On Aug 31, 2009, at 2:38 PM, martin wrote:
do u mean this line:
var plane:Plane = new Plane({material:_video});
i experiment with a VideoMaterial, but i get always casting problem:
_videoTexture = new VideoMaterial(_video);
var plane:Plane = new Plane({material:_videoTexture.video});
or
var plane:Plane = new Plane({material:_videoTexture});
how can i allocate the videotexture to the plane material?
thx
On 31 Aug., 13:58, Fabrice3D <[email protected]> wrote:
no you need to make a VideoMaterial,
your _video becomes then material.video
Fabrice
On Aug 31, 2009, at 12:23 PM, martin wrote:
hallo fabrice,
that is a good news!
it works good with an video object but i see nothing in my scene!? i
hear only the audio and see nothing - do u see my mistake!?
private function loadVideo() : void
{
var customClient:Object = new Object();
customClient["onCuePoint"] = cuePointHandler;
customClient["onMetaData"] = metaDataHandler;
_connection = new NetConnection();
_connection.connect(null);
_stream = new NetStream(_connection);
_stream.checkPolicyFile = true;
_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR,
asyncErrorHandler);
_stream.client = customClient;
_video = new Video(_videoWidth, _videoHeight);
_video.attachNetStream(_stream);
_stream.play('http://www.domain.com/myvideo.flv')
;
trace("loadVideo done...");
}
private function cuePointHandler(infoObject_ : Object) :
void
{
trace("cuePointHandler");
}
private function metaDataHandler(infoObject_ : Object) :
void
{
trace("metaDataHandler");
trace(infoObject_);
}
private function asyncErrorHandler(event:AsyncErrorEvent) :
void
{
trace("asyncErrorHandler");
}
private function createScene():void
{
var plane:Plane = new Plane({material:_video});
this.scene.addChild(plane);
plane.width = 2000;
plane.height = 1500;
plane.rotationX = 45;
plane.z = -100;
camera.lookAt(plane.scenePosition);
camera.x = 0;
camera.y = 0;
camera.z = -500;
trace(plane.x + " - " + plane.y + " - " +
plane.z);
trace("done create scene...");
}
thx for your description! that was really helpful...
greets
martin
On 30 Aug., 01:48, Fabrice3D <[email protected]> wrote:
as long as you know where your video object is, there is no reason
why
it shouldn't work.
but you will have to make something custom. the video material
doesn't
support cuepoints out of the box yet.
on metadata event ,the metadata object contains the cuepoints
with a type, name, params and of course the timing
you will have to store this info and check the time of the video
while
playing and trigger.
I've wrote back in as2, some clases for this. the funcky thing is
that
with almost no changes
the system works not only on flv, but also on mp3, anything with a
duration...
Setting own custom cuepoints by code is also more flexible. you do
not
need to reencode the video if you need to update them.
In as3 it should not be that complex to setup.
Fabrice
On Aug 30, 2009, at 12:46 AM, martin wrote:
hey awayer,
is it possible to trigger cuepoint from my moviematerial (.flv).
the
moviematerial is on a 3d plane.
i know you can make the flv on a videodisplay component and this
component triggers cuepoits. but my video has a alpha channel and
this
doesn't work with a videodiplay component only with a real 3d
plane as
a videotexture.
is this possible in away3d!? i found nothing about this... i read,
it
is possible in papervision3d...
hope anyone can answer to this special question.
greets
martin