Changeset 612
- Timestamp:
- 11/11/09 20:40:25 (4 years ago)
- Location:
- trunk/fl5
- Files:
-
- 4 edited
-
player.swf (modified) (previous)
-
src/com/longtailvideo/jwplayer/player/PlayerVersion.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/view/components/ControlbarComponent.as (modified) (7 diffs)
-
src/com/longtailvideo/jwplayer/view/components/ControlbarComponentV4.as (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerVersion.as
r610 r612 3 3 4 4 public class PlayerVersion { 5 protected static var _version:String = "5.0.61 0beta";5 protected static var _version:String = "5.0.611 beta"; 6 6 7 7 public static function get version():String{ -
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/ControlbarComponent.as
r610 r612 7 7 import com.longtailvideo.jwplayer.player.IPlayer; 8 8 import com.longtailvideo.jwplayer.player.PlayerState; 9 import com.longtailvideo.jwplayer.plugins.PluginConfig; 10 import com.longtailvideo.jwplayer.utils.Animations; 9 11 import com.longtailvideo.jwplayer.utils.Draw; 10 12 import com.longtailvideo.jwplayer.utils.Strings; … … 20 22 import flash.text.TextFormat; 21 23 import flash.ui.Mouse; 24 import flash.utils.clearTimeout; 25 import flash.utils.setTimeout; 22 26 23 27 … … 91 95 protected var _height:Number; 92 96 93 97 protected var controlbarConfig:PluginConfig; 98 protected var animations:Animations; 99 protected var hiding:Number; 100 94 101 public function ControlbarComponent(player:IPlayer) { 95 102 super(player, "controlbar"); … … 102 109 setTime(0, 0); 103 110 updateVolumeSlider(); 104 } 105 111 controlbarConfig = _player.config.pluginConfig(_name); 112 animations = new Animations(this); 113 } 106 114 107 115 private function addEventListeners():void { … … 136 144 } 137 145 138 139 private function stateHandler(evt:PlayerEvent):void { 146 147 private function startFader():void { 148 if (controlbarConfig['position'] == 'over' || (_player.fullscreen && controlbarConfig['position'] != 'none')) { 149 if (!isNaN(hiding)) { 150 clearTimeout(hiding); 151 } 152 hiding = setTimeout(moveTimeout, 2000); 153 _player.controls.display.addEventListener(MouseEvent.MOUSE_MOVE, moveHandler); 154 } 155 } 156 157 private function stopFader():void { 158 if (!isNaN(hiding)) { 159 clearTimeout(hiding); 160 try { 161 _player.controls.display.removeEventListener(MouseEvent.MOUSE_MOVE, moveHandler); 162 } catch (e:Error) {} 163 } 164 Mouse.show(); 165 animations.fade(1, 0.5); 166 } 167 168 /** Show above controlbar on mousemove. **/ 169 private function moveHandler(evt:MouseEvent=null):void { 170 if (alpha == 0) { 171 animations.fade(1, 0.5); 172 } 173 clearTimeout(hiding); 174 hiding = setTimeout(moveTimeout, 2000); 175 Mouse.show(); 176 } 177 178 179 /** Hide above controlbar again when move has timed out. **/ 180 private function moveTimeout():void { 181 animations.fade(0, 0.5); 182 Mouse.hide(); 183 } 184 185 private function stateHandler(evt:PlayerEvent=null):void { 186 switch(_player.state) { 187 case PlayerState.BUFFERING: 188 case PlayerState.PLAYING: 189 startFader(); 190 break; 191 case PlayerState.PAUSED: 192 case PlayerState.IDLE: 193 stopFader(); 194 break; 195 } 140 196 updateControlbarState(); 141 197 redraw(); … … 356 412 357 413 private function volumeHandler(evt:ViewEvent):void { 358 var volume:Number = Math.round(evt.data * 100); 359 if (!_player.locked) { 360 var volumeEvent:MediaEvent = new MediaEvent(MediaEvent.JWPLAYER_MEDIA_VOLUME); 361 volumeEvent.volume = volume; 362 updateVolumeSlider(volumeEvent); 363 } 364 dispatchEvent(new ViewEvent(ViewEvent.JWPLAYER_VIEW_VOLUME, volume)); 414 if (!_player.mute) { 415 var volume:Number = Math.round(evt.data * 100); 416 if (!_player.locked) { 417 var volumeEvent:MediaEvent = new MediaEvent(MediaEvent.JWPLAYER_MEDIA_VOLUME); 418 volumeEvent.volume = volume; 419 updateVolumeSlider(volumeEvent); 420 } 421 dispatchEvent(new ViewEvent(ViewEvent.JWPLAYER_VIEW_VOLUME, volume)); 422 } 365 423 } 366 424 … … 491 549 setChildIndex(capRight, numChildren - 1); 492 550 493 updateControlbarState(); 551 stopFader(); 552 stateHandler(); 494 553 redraw(); 495 Mouse.show();496 554 } 497 555 -
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/ControlbarComponentV4.as
r609 r612 142 142 } 143 143 144 145 144 public function resize(width:Number, height:Number):void { 146 145 if (!(PlayerLayoutManager.testPosition(controlbarConfig['position']) || controlbarConfig['position'] == "over")) { … … 222 221 stage.addEventListener(MouseEvent.MOUSE_UP, upHandler); 223 222 } else { 224 scrubber = undefined;223 scrubber = null; 225 224 } 226 225 } … … 242 241 fixTime(); 243 242 } 244 245 246 /** Show above controlbar on mousemove. **/247 private function moveHandler(evt:MouseEvent=null):void {248 if (alpha == 0) {249 animations.fade(1);250 }251 clearTimeout(hiding);252 hiding = setTimeout(moveTimeout, 2000);253 Mouse.show();254 }255 256 257 /** Hide above controlbar again when move has timed out. **/258 private function moveTimeout():void {259 animations.fade(0);260 Mouse.hide();261 }262 263 243 264 244 /** Show a mute icon if playing. **/ … … 376 356 } 377 357 358 378 359 private function startFader():void { 379 360 if (controlbarConfig['position'] == 'over' || (_player.fullscreen && controlbarConfig['position'] != 'none')) { … … 396 377 animations.fade(1); 397 378 } 398 379 380 /** Show above controlbar on mousemove. **/ 381 private function moveHandler(evt:MouseEvent=null):void { 382 if (alpha == 0) { 383 animations.fade(1); 384 } 385 clearTimeout(hiding); 386 hiding = setTimeout(moveTimeout, 2000); 387 Mouse.show(); 388 } 389 390 391 /** Hide above controlbar again when move has timed out. **/ 392 private function moveTimeout():void { 393 animations.fade(0); 394 Mouse.hide(); 395 } 396 399 397 /** Process state changes **/ 400 private function stateHandler(evt:PlayerEvent= undefined):void {398 private function stateHandler(evt:PlayerEvent=null):void { 401 399 // TODO: Fix non-working fading 402 400 clearTimeout(hiding); 403 401 try { 404 var dps:String = stage['displayState'];405 406 402 switch (_player.state) { 407 403 case PlayerState.PLAYING: … … 531 527 } 532 528 var pct:Number = (scrubber.icon.x - scrubber.rail.x) / (scrubber.rail.width - scrubber.icon.width) * mpl; 533 scrubber = undefined;529 scrubber = null; 534 530 if (sliderType == 'volumeSlider') { 535 531 var volumeEvent:MediaEvent = new MediaEvent(MediaEvent.JWPLAYER_MEDIA_VOLUME);
Note: See TracChangeset
for help on using the changeset viewer.
