Packagecom.soma.view.video.skin
Classpublic class SomaVideoFullscreenSkin
InheritanceSomaVideoFullscreenSkin Inheritance flash.display.Sprite
ImplementsISomaVideoFullscreenSkin

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

http://www.mozilla.org/MPL/

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);
     
Now you know to add controls to the player, you can build your own fullscreen skin. The base will be a DisplayObject class, such as Sprite, implementing ISomaVideoMuteSkin.

Custom mute class
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);
        }
        
    }
}
   
Add the CustomFullscreenSkin to the SomaVideoControls instead of the default one:
var controls:SomaVideoControls = new SomaVideoControls();
controls.addControl(new CustomFullscreenSkin());
var player:SomaVideoPlayer = new SomaVideoPlayer("video/video.flv", controls);
addChild(player);
     
Get a skin

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 the SomaVideoControls documentation to add or create your own controls.

See also

Soma
SomaVideo
SomaVideoPlayer
SomaVideoEvent
SomaVideoControls
SomaVideoPlaySkin
SomaVideoTimeBarSkin
SomaVideoMuteSkin


Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
  
Register the SomaVideoPlayer instance that will be used with the skin class
SomaVideoFullscreenSkin
Property detail
backgroundAlphaproperty
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
backgroundColorproperty 
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
buttonAlphaproperty 
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
buttonColorproperty 
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
fullscreenButtonOffproperty 
fullscreenButtonOff:Sprite  [read-only]

Get the fullscreen off button.

Implementation
    public function get fullscreenButtonOff():Sprite
fullscreenButtonOnproperty 
fullscreenButtonOn:Sprite  [read-only]

Get the fullscreen on button.

Implementation
    public function get fullscreenButtonOn():Sprite
Constructor detail
SomaVideoFullscreenSkin()constructor
public function SomaVideoFullscreenSkin()

Creates a SomaVideoFullscreenSkin instance.

Method detail
dispose()method
public function 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).

fullscreenCallBack()method 
public function fullscreenCallBack(value:Boolean):void

Method that receives information from the FullscreenController.

Parameters
value:Boolean — A Boolean indicating whether the current display state is fullscreen.
registerPlayer()method 
public function registerPlayer(player:SomaVideoPlayer):void

Register the SomaVideoPlayer instance that will be used with the skin class

Parameters
player:SomaVideoPlayer — A SomaVideoPlayer instance.