Changeset 596


Ignore:
Timestamp:
11/10/09 21:49:40 (4 years ago)
Author:
pablo
Message:

Removed view component to locking mechanism
V4 control bar locks user input to the sliders when the player is in the locked state

Location:
trunk/fl5
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/fl5/src/com/longtailvideo/jwplayer/controller/Controller.as

    r589 r596  
    226226                                        _blockingResume = true; 
    227227                                } 
    228                                 _view.lock(plugin); 
    229228                                return true; 
    230229                        } 
     
    247246                                        finalizeSetup(); 
    248247                                } 
    249                                 _view.unlock(target); 
    250248                                return true; 
    251249                        } 
  • trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerVersion.as

    r595 r596  
    33         
    44        public class PlayerVersion { 
    5                 protected static var _version:String = "5.0.595 beta"; 
     5                protected static var _version:String = "5.0.596 beta"; 
    66                 
    77                public static function get version():String{ 
  • trunk/fl5/src/com/longtailvideo/jwplayer/view/View.as

    r592 r596  
    5353                private var _plugins:Object; 
    5454 
    55                 private var _lockLayer:MovieClip; 
    56                 private var _lockPlugin:IPlugin; 
    57                 private var _lockAnimator:Animations; 
    58  
    5955                private var _displayMasker:MovieClip; 
    6056 
     
    170166                        _logoLayer.addChild(_logo); 
    171167 
    172                         _lockLayer = setupLayer("lock", 6); 
    173                         setupLock(); 
    174168} 
    175169 
     
    201195                        _imageLayer.mask = _displayMasker; 
    202196                        _mediaLayer.mask = _displayMasker; 
    203                 } 
    204                  
    205                 private function setupLock():void { 
    206                         _lockLayer.mouseEnabled = false; 
    207                         _lockLayer.mouseChildren = true; 
    208                         _lockLayer.visible = false; 
    209                         _lockLayer.alpha = 0; 
    210                         _lockAnimator = new Animations(_lockLayer); 
    211197                } 
    212198                 
     
    283269                        } 
    284270 
    285                         resizeLock(); 
    286  
    287271                        PlayerV4Emulation.getInstance(_player).resize(_player.config.width, _player.config.height); 
    288272                } 
     
    294278                        bg.x = 0; 
    295279                        bg.y = 0; 
    296                 } 
    297  
    298                 private function resizeLock():void { 
    299                         _lockLayer.graphics.clear(); 
    300                         _lockLayer.graphics.beginFill(0x000000, 0.7); 
    301                         _lockLayer.graphics.drawRect(0, 0, RootReference.stage.stageWidth, RootReference.stage.stageHeight); 
    302                         _lockLayer.graphics.endFill(); 
    303                         _lockLayer.x = _lockLayer.y = 0; 
    304                          
    305                         if (_lockPlugin) { 
    306                                 (_lockPlugin as DisplayObject).x = 0; 
    307                                 (_lockPlugin as DisplayObject).y = 0; 
    308                                 var cfg:PluginConfig = _player.config.pluginConfig(_lockPlugin.id); 
    309                                 cfg['x'] = cfg['y'] = 0; 
    310                                 cfg['width'] = _lockLayer.width; 
    311                                 cfg['height'] = _lockLayer.height; 
    312                                 _lockPlugin.resize(cfg['width'], cfg['height']); 
    313                         } 
    314280                } 
    315281 
     
    445411                } 
    446412                 
    447                 public function lock(plugin:IPlugin):void { 
    448                         _lockAnimator.fade(1); 
    449  
    450                         if (_pluginsLayer.contains(plugin as DisplayObject)) { 
    451                                 _lockPlugin = _pluginsLayer.getChildAt(_pluginsLayer.getChildIndex(plugin as DisplayObject)) as IPlugin; 
    452                                 _pluginsLayer.removeChild(_lockPlugin as DisplayObject); 
    453                                 _lockLayer.addChild(_lockPlugin as DisplayObject); 
    454                         } 
    455                          
    456                         redraw(); 
    457                 } 
    458                  
    459                 public function unlock(plugin:IPlugin):void { 
    460                         if (plugin == _lockPlugin) { 
    461                                 _lockLayer.removeChild(_lockPlugin as DisplayObject); 
    462                                 _pluginsLayer.addChild(_lockPlugin as DisplayObject); 
    463                                 _lockPlugin = null; 
    464                         } 
    465                         _lockAnimator.fade(0); 
    466                          
    467                         redraw(); 
    468                 } 
    469  
    470413        } 
    471414} 
  • trunk/fl5/src/com/longtailvideo/jwplayer/view/components/ControlbarComponentV4.as

    r593 r596  
    212212                /** Handle mouse presses on sliders. **/ 
    213213                private function downHandler(evt:MouseEvent):void { 
    214                         scrubber = MovieClip(evt.target); 
    215                         if (blocking != true || scrubber.name == 'volumeSlider') { 
    216                                 var rct:Rectangle = new Rectangle(scrubber.rail.x, scrubber.icon.y, scrubber.rail.width - scrubber.icon.width, 0); 
    217                                 scrubber.icon.startDrag(true, rct); 
    218                                 stage.addEventListener(MouseEvent.MOUSE_UP, upHandler); 
    219                         } else { 
    220                                 scrubber = undefined; 
     214                        if (!_player.locked) { 
     215                                scrubber = MovieClip(evt.target); 
     216                                if (blocking != true || scrubber.name == 'volumeSlider') { 
     217                                        var rct:Rectangle = new Rectangle(scrubber.rail.x, scrubber.icon.y, scrubber.rail.width - scrubber.icon.width, 0); 
     218                                        scrubber.icon.startDrag(true, rct); 
     219                                        stage.addEventListener(MouseEvent.MOUSE_UP, upHandler); 
     220                                } else { 
     221                                        scrubber = undefined; 
     222                                } 
    221223                        } 
    222224                } 
Note: See TracChangeset for help on using the changeset viewer.