| 1 | package com.longtailvideo.jwplayer.view { |
|---|
| 2 | import com.longtailvideo.jwplayer.events.GlobalEventDispatcher; |
|---|
| 3 | import com.longtailvideo.jwplayer.events.MediaEvent; |
|---|
| 4 | import com.longtailvideo.jwplayer.events.PlayerEvent; |
|---|
| 5 | import com.longtailvideo.jwplayer.events.PlayerStateEvent; |
|---|
| 6 | import com.longtailvideo.jwplayer.events.PlaylistEvent; |
|---|
| 7 | import com.longtailvideo.jwplayer.events.ViewEvent; |
|---|
| 8 | import com.longtailvideo.jwplayer.model.Model; |
|---|
| 9 | import com.longtailvideo.jwplayer.player.IPlayer; |
|---|
| 10 | import com.longtailvideo.jwplayer.player.PlayerState; |
|---|
| 11 | import com.longtailvideo.jwplayer.player.PlayerV4Emulation; |
|---|
| 12 | import com.longtailvideo.jwplayer.plugins.IPlugin; |
|---|
| 13 | import com.longtailvideo.jwplayer.plugins.PluginConfig; |
|---|
| 14 | import com.longtailvideo.jwplayer.utils.AssetLoader; |
|---|
| 15 | import com.longtailvideo.jwplayer.utils.Draw; |
|---|
| 16 | import com.longtailvideo.jwplayer.utils.Logger; |
|---|
| 17 | import com.longtailvideo.jwplayer.utils.RootReference; |
|---|
| 18 | import com.longtailvideo.jwplayer.utils.Stretcher; |
|---|
| 19 | import com.longtailvideo.jwplayer.view.interfaces.IControlbarComponent; |
|---|
| 20 | import com.longtailvideo.jwplayer.view.interfaces.IDisplayComponent; |
|---|
| 21 | import com.longtailvideo.jwplayer.view.interfaces.IDockComponent; |
|---|
| 22 | import com.longtailvideo.jwplayer.view.interfaces.IPlayerComponent; |
|---|
| 23 | import com.longtailvideo.jwplayer.view.interfaces.IPlaylistComponent; |
|---|
| 24 | import com.longtailvideo.jwplayer.view.interfaces.ISkin; |
|---|
| 25 | |
|---|
| 26 | import flash.display.Bitmap; |
|---|
| 27 | import flash.display.DisplayObject; |
|---|
| 28 | import flash.display.Loader; |
|---|
| 29 | import flash.display.MovieClip; |
|---|
| 30 | import flash.display.Sprite; |
|---|
| 31 | import flash.display.Stage; |
|---|
| 32 | import flash.display.StageAlign; |
|---|
| 33 | import flash.display.StageDisplayState; |
|---|
| 34 | import flash.display.StageScaleMode; |
|---|
| 35 | import flash.events.ErrorEvent; |
|---|
| 36 | import flash.events.Event; |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | public class View extends GlobalEventDispatcher { |
|---|
| 40 | protected var _player:IPlayer; |
|---|
| 41 | protected var _model:Model; |
|---|
| 42 | protected var _skin:ISkin; |
|---|
| 43 | protected var _components:IPlayerComponents; |
|---|
| 44 | protected var _fullscreen:Boolean = false; |
|---|
| 45 | protected var stage:Stage; |
|---|
| 46 | |
|---|
| 47 | protected var _root:MovieClip; |
|---|
| 48 | |
|---|
| 49 | protected var _backgroundLayer:MovieClip; |
|---|
| 50 | protected var _mediaLayer:MovieClip; |
|---|
| 51 | protected var _imageLayer:MovieClip; |
|---|
| 52 | protected var _componentsLayer:MovieClip; |
|---|
| 53 | protected var _logoLayer:MovieClip; |
|---|
| 54 | protected var _pluginsLayer:MovieClip; |
|---|
| 55 | protected var _plugins:Object; |
|---|
| 56 | |
|---|
| 57 | protected var _displayMasker:MovieClip; |
|---|
| 58 | |
|---|
| 59 | protected var _image:AssetLoader; |
|---|
| 60 | protected var _logo:Logo; |
|---|
| 61 | |
|---|
| 62 | protected var layoutManager:PlayerLayoutManager; |
|---|
| 63 | |
|---|
| 64 | [Embed(source="../../../../../assets/flash/loader/loader.swf")] |
|---|
| 65 | protected var LoadingScreen:Class; |
|---|
| 66 | |
|---|
| 67 | [Embed(source="../../../../../assets/flash/loader/error.swf")] |
|---|
| 68 | protected var ErrorScreen:Class; |
|---|
| 69 | |
|---|
| 70 | protected var loaderScreen:Sprite; |
|---|
| 71 | protected var loaderAnim:DisplayObject; |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | public function View(player:IPlayer, model:Model) { |
|---|
| 75 | _player = player; |
|---|
| 76 | _model = model; |
|---|
| 77 | |
|---|
| 78 | RootReference.stage.scaleMode = StageScaleMode.NO_SCALE; |
|---|
| 79 | RootReference.stage.stage.align = StageAlign.TOP_LEFT; |
|---|
| 80 | |
|---|
| 81 | loaderScreen = new Sprite(); |
|---|
| 82 | loaderScreen.name = 'loaderScreen'; |
|---|
| 83 | |
|---|
| 84 | loaderAnim = new LoadingScreen() as DisplayObject; |
|---|
| 85 | loaderScreen.addChild(loaderAnim); |
|---|
| 86 | |
|---|
| 87 | RootReference.stage.addChildAt(loaderScreen, 0); |
|---|
| 88 | |
|---|
| 89 | if (RootReference.stage.stageWidth > 0) { |
|---|
| 90 | resizeStage(); |
|---|
| 91 | } else { |
|---|
| 92 | RootReference.stage.addEventListener(Event.RESIZE, resizeStage); |
|---|
| 93 | RootReference.stage.addEventListener(Event.ADDED_TO_STAGE, resizeStage); |
|---|
| 94 | } |
|---|
| 95 | |
|---|
| 96 | _root = new MovieClip(); |
|---|
| 97 | } |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | protected function resizeStage(evt:Event=null):void { |
|---|
| 101 | RootReference.stage.removeEventListener(Event.RESIZE, resizeStage); |
|---|
| 102 | RootReference.stage.removeEventListener(Event.ADDED_TO_STAGE, resizeStage); |
|---|
| 103 | |
|---|
| 104 | loaderScreen.graphics.clear(); |
|---|
| 105 | loaderScreen.graphics.beginFill(0, 1); |
|---|
| 106 | loaderScreen.graphics.drawRect(0, 0, RootReference.stage.stageWidth, RootReference.stage.stageHeight); |
|---|
| 107 | loaderScreen.graphics.endFill(); |
|---|
| 108 | |
|---|
| 109 | loaderAnim.x = (RootReference.stage.stageWidth - loaderAnim.width) / 2; |
|---|
| 110 | loaderAnim.y = (RootReference.stage.stageHeight - loaderAnim.height) / 2; |
|---|
| 111 | } |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | public function get skin():ISkin { |
|---|
| 115 | return _skin; |
|---|
| 116 | } |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | public function set skin(skn:ISkin):void { |
|---|
| 120 | _skin = skn; |
|---|
| 121 | } |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | public function setupView():void { |
|---|
| 125 | RootReference.stage.addChildAt(_root, 0); |
|---|
| 126 | _root.visible = false; |
|---|
| 127 | |
|---|
| 128 | setupLayers(); |
|---|
| 129 | setupComponents(); |
|---|
| 130 | |
|---|
| 131 | RootReference.stage.addEventListener(Event.FULLSCREEN, resizeHandler); |
|---|
| 132 | RootReference.stage.addEventListener(Event.RESIZE, resizeHandler); |
|---|
| 133 | |
|---|
| 134 | _model.addEventListener(MediaEvent.JWPLAYER_MEDIA_LOADED, mediaLoaded); |
|---|
| 135 | _model.playlist.addEventListener(PlaylistEvent.JWPLAYER_PLAYLIST_ITEM, itemHandler); |
|---|
| 136 | _model.playlist.addEventListener(PlaylistEvent.JWPLAYER_PLAYLIST_LOADED, itemHandler); |
|---|
| 137 | _model.playlist.addEventListener(PlaylistEvent.JWPLAYER_PLAYLIST_UPDATED, itemHandler); |
|---|
| 138 | _model.addEventListener(PlayerStateEvent.JWPLAYER_PLAYER_STATE, stateHandler); |
|---|
| 139 | |
|---|
| 140 | layoutManager = new PlayerLayoutManager(_player); |
|---|
| 141 | setupRightClick(); |
|---|
| 142 | |
|---|
| 143 | redraw(); |
|---|
| 144 | } |
|---|
| 145 | |
|---|
| 146 | protected function setupRightClick():void { |
|---|
| 147 | var menu:RightclickMenu = new RightclickMenu(_player, _root); |
|---|
| 148 | menu.addGlobalListener(forward); |
|---|
| 149 | } |
|---|
| 150 | |
|---|
| 151 | public function completeView(isError:Boolean=false, errorMsg:String=""):void { |
|---|
| 152 | if (!isError) { |
|---|
| 153 | _root.visible = true; |
|---|
| 154 | RootReference.stage.removeChild(loaderScreen); |
|---|
| 155 | } else { |
|---|
| 156 | loaderScreen.removeChild(loaderAnim); |
|---|
| 157 | var errorScreen:DisplayObject = new ErrorScreen() as DisplayObject; |
|---|
| 158 | errorScreen.x = (loaderScreen.width - errorScreen.width) / 2; |
|---|
| 159 | errorScreen.y = (loaderScreen.height - errorScreen.height) / 2; |
|---|
| 160 | loaderScreen.addChild(errorScreen); |
|---|
| 161 | } |
|---|
| 162 | } |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | protected function setupLayers():void { |
|---|
| 166 | _backgroundLayer = setupLayer("background", 0); |
|---|
| 167 | setupBackground(); |
|---|
| 168 | |
|---|
| 169 | _mediaLayer = setupLayer("media", 1); |
|---|
| 170 | _mediaLayer.visible = false; |
|---|
| 171 | |
|---|
| 172 | _imageLayer = setupLayer("image", 2); |
|---|
| 173 | _image = new AssetLoader(); |
|---|
| 174 | |
|---|
| 175 | _componentsLayer = setupLayer("components", 3); |
|---|
| 176 | |
|---|
| 177 | _pluginsLayer = setupLayer("plugins", 4); |
|---|
| 178 | _plugins = {}; |
|---|
| 179 | |
|---|
| 180 | _logoLayer = setupLayer("logo", 5); |
|---|
| 181 | _logo = new Logo(_player); |
|---|
| 182 | _logoLayer.addChild(_logo); |
|---|
| 183 | } |
|---|
| 184 | |
|---|
| 185 | |
|---|
| 186 | protected function setupLayer(name:String, index:Number):MovieClip { |
|---|
| 187 | var layer:MovieClip = new MovieClip(); |
|---|
| 188 | _root.addChildAt(layer, index); |
|---|
| 189 | layer.name = name; |
|---|
| 190 | layer.x = 0; |
|---|
| 191 | layer.y = 0; |
|---|
| 192 | return layer; |
|---|
| 193 | } |
|---|
| 194 | |
|---|
| 195 | |
|---|
| 196 | protected function setupBackground():void { |
|---|
| 197 | var background:MovieClip = new MovieClip(); |
|---|
| 198 | background.name = "background"; |
|---|
| 199 | _backgroundLayer.addChild(background); |
|---|
| 200 | background.graphics.beginFill(_player.config.screencolor ? _player.config.screencolor.color : 0x000000, 1); |
|---|
| 201 | background.graphics.drawRect(0, 0, 1, 1); |
|---|
| 202 | background.graphics.endFill(); |
|---|
| 203 | } |
|---|
| 204 | |
|---|
| 205 | |
|---|
| 206 | protected function setupDisplayMask():void { |
|---|
| 207 | _displayMasker = new MovieClip(); |
|---|
| 208 | _displayMasker.graphics.beginFill(0x000000, 1); |
|---|
| 209 | _displayMasker.graphics.drawRect(0, 0, _player.config.width, _player.config.height); |
|---|
| 210 | _displayMasker.graphics.endFill(); |
|---|
| 211 | |
|---|
| 212 | _backgroundLayer.mask = _displayMasker; |
|---|
| 213 | _imageLayer.mask = _displayMasker; |
|---|
| 214 | _mediaLayer.mask = _displayMasker; |
|---|
| 215 | } |
|---|
| 216 | |
|---|
| 217 | |
|---|
| 218 | protected function setupComponents():void { |
|---|
| 219 | _components = new PlayerComponents(_player); |
|---|
| 220 | |
|---|
| 221 | setupComponent(_components.display, 0); |
|---|
| 222 | setupComponent(_components.playlist, 1); |
|---|
| 223 | setupComponent(_components.controlbar, 2); |
|---|
| 224 | setupComponent(_components.dock, 3); |
|---|
| 225 | } |
|---|
| 226 | |
|---|
| 227 | |
|---|
| 228 | protected function setupComponent(component:IPlayerComponent, index:Number):void { |
|---|
| 229 | component.addGlobalListener(forward); |
|---|
| 230 | _componentsLayer.addChildAt(component as DisplayObject, index); |
|---|
| 231 | } |
|---|
| 232 | |
|---|
| 233 | |
|---|
| 234 | protected function resizeHandler(event:Event):void { |
|---|
| 235 | redraw(); |
|---|
| 236 | |
|---|
| 237 | var currentFSMode:Boolean = (RootReference.stage.displayState == StageDisplayState.FULL_SCREEN); |
|---|
| 238 | if (_model.fullscreen != currentFSMode) { |
|---|
| 239 | dispatchEvent(new ViewEvent(ViewEvent.JWPLAYER_VIEW_FULLSCREEN, currentFSMode)); |
|---|
| 240 | } |
|---|
| 241 | } |
|---|
| 242 | |
|---|
| 243 | |
|---|
| 244 | public function fullscreen(mode:Boolean=true):void { |
|---|
| 245 | RootReference.stage.displayState = mode ? StageDisplayState.FULL_SCREEN : StageDisplayState.NORMAL; |
|---|
| 246 | } |
|---|
| 247 | |
|---|
| 248 | |
|---|
| 249 | /** Redraws the plugins and player components **/ |
|---|
| 250 | public function redraw():void { |
|---|
| 251 | layoutManager.resize(RootReference.stage.stageWidth, RootReference.stage.stageHeight); |
|---|
| 252 | |
|---|
| 253 | _components.resize(_player.config.width, _player.config.height); |
|---|
| 254 | |
|---|
| 255 | resizeBackground(); |
|---|
| 256 | resizeMasker(); |
|---|
| 257 | |
|---|
| 258 | if (_imageLayer.numChildren) { |
|---|
| 259 | _imageLayer.x = _components.display.x; |
|---|
| 260 | _imageLayer.y = _components.display.y; |
|---|
| 261 | Stretcher.stretch(_image.loadedObject, _player.config.width, _player.config.height, _player.config.stretching); |
|---|
| 262 | } |
|---|
| 263 | |
|---|
| 264 | if (_mediaLayer.numChildren && _model.media.display) { |
|---|
| 265 | _mediaLayer.x = _components.display.x; |
|---|
| 266 | _mediaLayer.y = _components.display.y; |
|---|
| 267 | _model.media.resize(_player.config.width, _player.config.height); |
|---|
| 268 | } |
|---|
| 269 | |
|---|
| 270 | if (_logoLayer.numChildren) { |
|---|
| 271 | _logoLayer.x = _components.display.x; |
|---|
| 272 | _logoLayer.y = _components.display.y; |
|---|
| 273 | _logo.resize(_player.config.width, _player.config.height); |
|---|
| 274 | } |
|---|
| 275 | |
|---|
| 276 | for (var i:Number = 0; i < _pluginsLayer.numChildren; i++) { |
|---|
| 277 | var plug:IPlugin = _pluginsLayer.getChildAt(i) as IPlugin; |
|---|
| 278 | var plugDisplay:DisplayObject = plug as DisplayObject; |
|---|
| 279 | if (plug && plugDisplay) { |
|---|
| 280 | var cfg:PluginConfig = _player.config.pluginConfig(plug.id); |
|---|
| 281 | if (cfg['visible']) { |
|---|
| 282 | plugDisplay.visible = true; |
|---|
| 283 | plugDisplay.x = cfg['x']; |
|---|
| 284 | plugDisplay.y = cfg['y']; |
|---|
| 285 | try { |
|---|
| 286 | plug.resize(cfg.width, cfg.height); |
|---|
| 287 | } catch (e:Error) { |
|---|
| 288 | Logger.log("There was an error resizing plugin '" + plug.id + "': " + e.message); |
|---|
| 289 | } |
|---|
| 290 | } else { |
|---|
| 291 | plugDisplay.visible = false; |
|---|
| 292 | } |
|---|
| 293 | } |
|---|
| 294 | } |
|---|
| 295 | |
|---|
| 296 | PlayerV4Emulation.getInstance(_player).resize(_player.config.width, _player.config.height); |
|---|
| 297 | } |
|---|
| 298 | |
|---|
| 299 | |
|---|
| 300 | protected function resizeBackground():void { |
|---|
| 301 | var bg:DisplayObject = _backgroundLayer.getChildByName("background"); |
|---|
| 302 | bg.width = RootReference.stage.stageWidth; |
|---|
| 303 | bg.height = RootReference.stage.stageHeight; |
|---|
| 304 | bg.x = 0; |
|---|
| 305 | bg.y = 0; |
|---|
| 306 | } |
|---|
| 307 | |
|---|
| 308 | |
|---|
| 309 | protected function resizeMasker():void { |
|---|
| 310 | if (_displayMasker == null) |
|---|
| 311 | setupDisplayMask(); |
|---|
| 312 | |
|---|
| 313 | _displayMasker.graphics.clear(); |
|---|
| 314 | _displayMasker.graphics.beginFill(0, 1); |
|---|
| 315 | _displayMasker.graphics.drawRect(_components.display.x, _components.display.y, _player.config.width, _player.config.height); |
|---|
| 316 | _displayMasker.graphics.endFill(); |
|---|
| 317 | } |
|---|
| 318 | |
|---|
| 319 | |
|---|
| 320 | public function get components():IPlayerComponents { |
|---|
| 321 | return _components; |
|---|
| 322 | } |
|---|
| 323 | |
|---|
| 324 | |
|---|
| 325 | public function overrideComponent(newComponent:IPlayerComponent):void { |
|---|
| 326 | if (newComponent is IControlbarComponent) { |
|---|
| 327 | // Replace controlbar |
|---|
| 328 | } else if (newComponent is IDisplayComponent) { |
|---|
| 329 | // Replace display |
|---|
| 330 | } else if (newComponent is IDockComponent) { |
|---|
| 331 | // Replace dock |
|---|
| 332 | } else if (newComponent is IPlaylistComponent) { |
|---|
| 333 | // Replace playlist |
|---|
| 334 | } else { |
|---|
| 335 | dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, "Component must implement a component interface")); |
|---|
| 336 | } |
|---|
| 337 | } |
|---|
| 338 | |
|---|
| 339 | |
|---|
| 340 | public function addPlugin(id:String, plugin:IPlugin):void { |
|---|
| 341 | try { |
|---|
| 342 | var plugDO:DisplayObject = plugin as DisplayObject; |
|---|
| 343 | if (!_plugins[id] && plugDO != null) { |
|---|
| 344 | _plugins[id] = plugDO; |
|---|
| 345 | _pluginsLayer.addChild(plugDO); |
|---|
| 346 | //_pluginsLayer[id] = plugDO; |
|---|
| 347 | } |
|---|
| 348 | } catch (e:Error) { |
|---|
| 349 | dispatchEvent(new ErrorEvent(ErrorEvent.ERROR, false, false, e.message)); |
|---|
| 350 | } |
|---|
| 351 | } |
|---|
| 352 | |
|---|
| 353 | |
|---|
| 354 | public function removePlugin(plugin:IPlugin):void { |
|---|
| 355 | var id:String = plugin.id.toLowerCase(); |
|---|
| 356 | if (id && _plugins[id] is IPlugin) { |
|---|
| 357 | _pluginsLayer.removeChild(_plugins[id]); |
|---|
| 358 | delete _plugins[id]; |
|---|
| 359 | } |
|---|
| 360 | } |
|---|
| 361 | |
|---|
| 362 | |
|---|
| 363 | public function loadedPlugins():Array { |
|---|
| 364 | var list:Array = []; |
|---|
| 365 | for (var pluginId:String in _plugins) { |
|---|
| 366 | if (_plugins[pluginId] is IPlugin) { |
|---|
| 367 | list.push(pluginId); |
|---|
| 368 | } |
|---|
| 369 | } |
|---|
| 370 | return list; |
|---|
| 371 | } |
|---|
| 372 | |
|---|
| 373 | |
|---|
| 374 | public function getPlugin(id:String):IPlugin { |
|---|
| 375 | return _plugins[id] as IPlugin; |
|---|
| 376 | } |
|---|
| 377 | |
|---|
| 378 | |
|---|
| 379 | public function bringPluginToFront(id:String):void { |
|---|
| 380 | var plugin:IPlugin = getPlugin(id); |
|---|
| 381 | _pluginsLayer.setChildIndex(plugin as DisplayObject, _pluginsLayer.numChildren - 1); |
|---|
| 382 | } |
|---|
| 383 | |
|---|
| 384 | |
|---|
| 385 | protected function mediaLoaded(evt:MediaEvent):void { |
|---|
| 386 | _mediaLayer.x = _components.display.x; |
|---|
| 387 | _mediaLayer.y = _components.display.y; |
|---|
| 388 | if (_model.media.display) { |
|---|
| 389 | _model.media.resize(_player.config.width, _player.config.height); |
|---|
| 390 | _mediaLayer.addChild(_model.media.display); |
|---|
| 391 | } |
|---|
| 392 | } |
|---|
| 393 | |
|---|
| 394 | |
|---|
| 395 | protected function itemHandler(evt:PlaylistEvent):void { |
|---|
| 396 | while (_mediaLayer.numChildren) { |
|---|
| 397 | _mediaLayer.removeChildAt(0); |
|---|
| 398 | } |
|---|
| 399 | if (_model.playlist.currentItem && _model.playlist.currentItem.image) { |
|---|
| 400 | loadImage(_model.playlist.currentItem.image); |
|---|
| 401 | |
|---|
| 402 | } |
|---|
| 403 | } |
|---|
| 404 | |
|---|
| 405 | |
|---|
| 406 | protected function loadImage(url:String):void { |
|---|
| 407 | while (_imageLayer.numChildren) { |
|---|
| 408 | _imageLayer.removeChildAt(0); |
|---|
| 409 | } |
|---|
| 410 | |
|---|
| 411 | _image = new AssetLoader(); |
|---|
| 412 | _image.addEventListener(Event.COMPLETE, imageComplete); |
|---|
| 413 | _image.addEventListener(ErrorEvent.ERROR, imageError); |
|---|
| 414 | _image.load(url); |
|---|
| 415 | } |
|---|
| 416 | |
|---|
| 417 | |
|---|
| 418 | protected function imageComplete(evt:Event):void { |
|---|
| 419 | Draw.smooth((_image.loadedObject as Loader).content as Bitmap); |
|---|
| 420 | _imageLayer.addChild(_image.loadedObject); |
|---|
| 421 | _imageLayer.x = _components.display.x; |
|---|
| 422 | _imageLayer.y = _components.display.y; |
|---|
| 423 | Stretcher.stretch(_image.loadedObject, _player.config.width, _player.config.height, _player.config.stretching); |
|---|
| 424 | } |
|---|
| 425 | |
|---|
| 426 | |
|---|
| 427 | protected function imageError(evt:ErrorEvent):void { |
|---|
| 428 | _image = null; |
|---|
| 429 | Logger.log('Error loading preview image: '+evt.text); |
|---|
| 430 | //dispatchEvent(new PlayerEvent(PlayerEvent.JWPLAYER_ERROR, evt.text)); |
|---|
| 431 | } |
|---|
| 432 | |
|---|
| 433 | |
|---|
| 434 | protected function stateHandler(evt:PlayerStateEvent):void { |
|---|
| 435 | switch (evt.newstate) { |
|---|
| 436 | case PlayerState.IDLE: |
|---|
| 437 | _imageLayer.visible = true; |
|---|
| 438 | _mediaLayer.visible = false; |
|---|
| 439 | _logoLayer.visible = false; |
|---|
| 440 | break; |
|---|
| 441 | case PlayerState.PLAYING: |
|---|
| 442 | if (_model.media.display) { |
|---|
| 443 | _imageLayer.visible = false; |
|---|
| 444 | _mediaLayer.visible = true; |
|---|
| 445 | } |
|---|
| 446 | _logoLayer.visible = true; |
|---|
| 447 | break; |
|---|
| 448 | } |
|---|
| 449 | } |
|---|
| 450 | |
|---|
| 451 | |
|---|
| 452 | protected function forward(evt:Event):void { |
|---|
| 453 | if (evt is PlayerEvent) |
|---|
| 454 | dispatchEvent(evt); |
|---|
| 455 | } |
|---|
| 456 | } |
|---|
| 457 | } |
|---|