How to: Hide video skin when playing, otherwise show skin?
I'm using the default CS4 FLVPlayback skin, mainly the 开发者_运维问答SkinOverPlayMute.swf. I know there's a skinAutoHide option, but because I don't want it to auto play, I want people to see a play button when they first encounter the video (so they don't think it's just an image). But the skin needs to hide when the video is actually playing (so the video doesn't get blocked by the controls).
In other works - when video isn't playing: skin showing; when video is playing: skin hide.
Hope that makes sense!
Give this a try, replacing video_instance with the instance name of your video obviously.
var features:Array = [
"playButton",
"pauseButton",
"playPauseButton",
"stopButton",
"muteButton",
"backButton",
"forwardButton",
"volumeBar",
"seekBar",
"bufferingBar",
"fullScreenButton"
];
function setSkinVisible(player:FLVPlayback, bool:Boolean=true):void
{
var i:String;
for each(i in features)
{
var t:Sprite = player[i];
if(t != null)
t.visible = bool;
}
}
// test
addEventListener(Event.ENTER_FRAME, _handle);
function _handle(e:Event):void
{
setSkinVisible(video_instance, !video_instance.playing);
}
精彩评论