| Package | com.soma.view.video.skin |
| Class | public class SomaVideoFullscreenSkin |
| Inheritance | SomaVideoFullscreenSkin flash.display.Sprite |
| Implements | ISomaVideoFullscreenSkin |
Author: Romuald Quantin - www.soundstep.com
Information:
Blog page - SomaUI
How does it work - Soma Protest
Project Host - Google Code
Documentation - Soma ASDOC
Class version: 2.0
Actionscript version: 3.0
Copyright:
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and
limitations under the License.
The Original Code is Soma.
The Initial Developer of the Original Code is Romuald Quantin.
Initial Developer are Copyright (C) 2008-2009 Soundstep. All Rights Reserved.
Usage:
Default control skin for a SomaVideoPlayer fullscreen button, automatically instantiated by the SomaVideoControls class if you dont specify one in the SomaVideoPlayer instance.
How to add controls to the player
The following code is reproducing how the default controls are added in the SomaVideoControls class (by default).
var controls:SomaVideoControls = new SomaVideoControls();
controls.addControl(new SomaVideoPlaySkin());
controls.addControl(new SomaVideoTimeBarSkin());
controls.addControl(new SomaVideoMuteSkin());
controls.addControl(new SomaVideoFullscreenSkin());
var player:SomaVideoPlayer = new SomaVideoPlayer("video/video.flv", controls);
addChild(player);
package {
import com.soma.view.video.SomaVideoPlayer;
import com.soma.view.video.skin.ISomaVideoFullscreenSkin;
import flash.display.Sprite;
public class CustomFullscreenSkin extends Sprite implements ISomaVideoFullscreenSkin {
private var _player:SomaVideoPlayer;
public function CustomFullscreenSkin() {
createSkinElements();
}
private function createSkinElements():void {
// create fullcreen buttons here and use:
// _player.fullscreen = false;
// _player.fullscreen = true;
}
public function registerPlayer(player:SomaVideoPlayer):void {
_player = player;
}
public function dispose():void {
// remove skin elements and events listeners for cleaning when the SomaVideoPlayer instance is disposed.
}
public function fullscreenCallBack(value:Boolean):void {
// here the controllers will indicate when the fullscreen state has changed.
trace("Fullscreen state: ", value);
}
}
}
var controls:SomaVideoControls = new SomaVideoControls();
controls.addControl(new CustomFullscreenSkin());
var player:SomaVideoPlayer = new SomaVideoPlayer("video/video.flv", controls);
addChild(player);
var player:SomaVideoPlayer = new SomaVideoPlayer("video/video.flv");
addChild(player);
var skin:SomaVideoFullscreenSkin = player.controls.getControl(SomaVideoFullscreenSkin) as SomaVideoFullscreenSkin;
skin.backgroundColor = 0xFF0000;
skin.backgroundAlpha = .5;
See also
| Property | Defined by | ||
|---|---|---|---|
| backgroundAlpha : Number Specifies the background transparency of the skin (default alpha 0).
| SomaVideoFullscreenSkin | ||
| backgroundColor : uint Specifies the background color of the skin (default is black).
| SomaVideoFullscreenSkin | ||
| buttonAlpha : Number Specifies the default transparency of the buttons (default alpha 1).
| SomaVideoFullscreenSkin | ||
| buttonColor : uint Specifies the default color of the buttons (default is white).
| SomaVideoFullscreenSkin | ||
| fullscreenButtonOff : Sprite [read-only] Get the fullscreen off button.
| SomaVideoFullscreenSkin | ||
| fullscreenButtonOn : Sprite [read-only] Get the fullscreen on button.
| SomaVideoFullscreenSkin | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a SomaVideoFullscreenSkin instance.
| SomaVideoFullscreenSkin | ||
|
dispose():void
This method is internally called when you dispose a SomaVideoPlayer to remove children, the event listeners or whatever that needs to be destroyed to free the memory (make the instance elligible to the Garbage Collection).
| SomaVideoFullscreenSkin | ||
|
fullscreenCallBack(value:Boolean):void
Method that receives information from the FullscreenController.
| SomaVideoFullscreenSkin | ||
|
registerPlayer(player:SomaVideoPlayer):void
Register the SomaVideoPlayer instance that will be used with the skin class
| SomaVideoFullscreenSkin | ||
| backgroundAlpha | property |
backgroundAlpha:Number [read-write]Specifies the background transparency of the skin (default alpha 0).
Implementation public function get backgroundAlpha():Number
public function set backgroundAlpha(value:Number):void
| backgroundColor | property |
backgroundColor:uint [read-write]Specifies the background color of the skin (default is black).
Implementation public function get backgroundColor():uint
public function set backgroundColor(value:uint):void
| buttonAlpha | property |
buttonAlpha:Number [read-write]Specifies the default transparency of the buttons (default alpha 1).
Implementation public function get buttonAlpha():Number
public function set buttonAlpha(value:Number):void
| buttonColor | property |
buttonColor:uint [read-write]Specifies the default color of the buttons (default is white).
Implementation public function get buttonColor():uint
public function set buttonColor(value:uint):void
| fullscreenButtonOff | property |
fullscreenButtonOff:Sprite [read-only]Get the fullscreen off button.
Implementation public function get fullscreenButtonOff():Sprite
| fullscreenButtonOn | property |
fullscreenButtonOn:Sprite [read-only]Get the fullscreen on button.
Implementation public function get fullscreenButtonOn():Sprite
| SomaVideoFullscreenSkin | () | constructor |
public function SomaVideoFullscreenSkin()Creates a SomaVideoFullscreenSkin instance.
| dispose | () | method |
public function dispose():voidThis method is internally called when you dispose a SomaVideoPlayer to remove children, the event listeners or whatever that needs to be destroyed to free the memory (make the instance elligible to the Garbage Collection).
| fullscreenCallBack | () | method |
public function fullscreenCallBack(value:Boolean):voidMethod that receives information from the FullscreenController.
Parametersvalue:Boolean — A Boolean indicating whether the current display state is fullscreen.
|
| registerPlayer | () | method |
public function registerPlayer(player:SomaVideoPlayer):voidRegister the SomaVideoPlayer instance that will be used with the skin class
Parametersplayer:SomaVideoPlayer — A SomaVideoPlayer instance.
|