There is an ugly bug with the VideoPlayer class where is thinks it reset the
volume when it hasn't. Here is my work around and the only thing I have found
that works:
1) I set up a function that sets the value of everything (volume variable,
VideoDisplay.volume, and VSlider.value):
protected function setVolume(v:Number):void{
_volume = v;
vDisplay.volume = v;
vVolume.value = v;
}
2) When the video gets loaded in (using VideoEvent.READY) then it has to call
the setVolume twice (yes, twice):
setVolume(0.01);
var v:Number = _volume;
setVolume(v);
First, we set the volume to 0.01. Right after that we set it to the real value.
But here's the catch. You can't do setVolume(_volume) on the second call for
some reason. It keeps the value at 0.01. So we have to make a temporary value
and set that to the correct value and then it will work. Happy coding!
----- Original Message ----
From: David Freerksen <[EMAIL PROTECTED]>
To: [flexcomponents] <[email protected]>
Sent: Thursday, December 27, 2007 4:59:48 PM
Subject: [flexcomponents] VideoDisplay volume
I am building a video gallery. The very last thing I have to get fixed is the
volume on the VideoDisplay. I have a slider that when you slide it, it changes
the value of a variable. This variable represents the volume. So when a new
video gets loaded in, it looks to see what the variable is to set the
VideoDisplay. volume to this value. So when you change the volume on one video
is works fine. Now click on a button to load in a new video and it breaks. It
goes back to the default Flex volume value (which is .75). I slide the volume
slider to 0. I've traced out the value of both the volume variable and
VideoDisplay. volume and they both return the same value. But I still hear
audio. Has anyone run across this issue before?
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping