VideoTexture does not appear

Software: Away3D 4.x

NickStone1983, Newbie
Posted: 20 November 2013 04:54 PM   Total Posts: 8

Hi,

I’ve got a plane mesh which has a VideoTexture, instantiated thus:

var vt:VideoTexture = new VideoTexture(URL.VID_SRC);

Now, when I apply this to a mesh and add to scene, the mesh is entirely black - the sound from the video is present, but no video. I’ve set autoUpdate to true, no joy, there doesn’t appear to be much on the net by way of this error. Can anyone suggest anything?

Also, ideally I need to be able to cache the video, and not have it stream - I don’t know how it actually happens (as have hit a brick wall with this!), if anyone could help I’d be much obliged!

Thanks

 

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 04 December 2013 03:45 PM   Total Posts: 166   [ # 1 ]

Do you use F4V or FLV?
If you use F4V, try FLV.
But Im not sure…
Good luck!

   

NickStone1983, Newbie
Posted: 10 December 2013 10:39 AM   Total Posts: 8   [ # 2 ]

Hey,

I’m using MP4, and can’t get the resources in any other format. Apparently this is supported, but doesn’t seem to be fully working…have updated to latest version of Away3D as well

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 10 December 2013 11:10 AM   Total Posts: 166   [ # 3 ]

Sorry for my miss leading…

I can’t see your code,
so, I can say only a few of possibilities.

1.
Confirm “autoPlay==true” on the texture constructor. Default is false.
If you want to start manualy, use vTexture.player.play();

vTexture = new VideoTexture(video256256falsetrue); 

2.
Confirm whether your video is drawable or not.
Below is VideoTexture.update function.

public function update():void
{
 
if (_player.playing && !_player.paused{
  bitmapData
.lock();
  
bitmapData.fillRect(_clippingRect0);
  
bitmapData.draw(_player.containernullnullnull_clippingRect);
  
bitmapData.unlock();
  
invalidateContent();
 
}

VideoTexture is sub class of BitmapTexture.
And it just draw your video to BitmapTexture.bitmapData on update().
So, you can know your video format is drawable or not,
by bellow code.

addChild(new Bitmap(vTexturebitmapData)); 

If you play the video correctly, and your video is drawable,
you get video images on your screen.

Good luck.

   
   
‹‹ Shadows and specular

X

Away3D Forum

Member Login

Username

Password

Remember_me



X