ywywdh / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

VideoStreamMaterial will not play if created after the NetStream.Play.Start event #171

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Create a Video that streams from some FLV.
Wait one second.
Then create a VideoStreamMaterial and add it to a Plane.
The material will show up as black. If we do not delay one second, it will
show up fine.

The bug is that VideoStreamMaterial's constructor does not correctly pass
the animated = true flag to the super. When it calls super(...) on line 93,
it omits the third argument, which should be true.

A second way to address this bug is on line 170, add a default: case to the
onStreamStatus switch block. default: should set animated to true.

This is important because sometimes you want to create a
VideoStreamMaterial only after onMetadata is called (so you can get the
video's width and height). At this point, it's too late to hit the
NetStream.Play.Start case in VideoStreamMaterial's onStreamStatus handler.
Animated is false, due to the constructor bug, so the video never renders.

Thanks!

Original issue reported on code.google.com by ron...@gmail.com on 18 Feb 2009 at 7:23

GoogleCodeExporter commented 9 years ago
I experienced this on r876. I'm currently just passing a third parameter to 
super:
super ( DisplayObject(video), transparent, true );

This seems to solve the problem for my purposes.

Original comment by ron...@gmail.com on 18 Feb 2009 at 7:26

GoogleCodeExporter commented 9 years ago
Hi.  I experienced this too and I've voted for this issue.  But I was able to 
solve
it without needing to modify the papervision source.  animated is a public 
property
of MovieMaterial, simply set it to true.

Perhaps that won't work with specific implementations but it worked for me so I
thought I'd share that here.

Cheers.

Original comment by roblin...@gmail.com on 4 Feb 2010 at 7:02