Changeset 1282
- Timestamp:
- 09/17/10 13:38:40 (3 years ago)
- Location:
- trunk/fl5
- Files:
-
- 12 edited
-
player.swf (modified) (previous)
-
src/com/longtailvideo/jwplayer/media/RTMPMediaProvider.as (modified) (2 diffs)
-
src/com/longtailvideo/jwplayer/player/JavascriptAPI.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/player/JavascriptCompatibilityAPI.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/player/PlayerVersion.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/utils/JavascriptSerialization.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/view/components/ComponentButton.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/view/components/ControlbarComponent.as (modified) (6 diffs)
-
src/com/longtailvideo/jwplayer/view/components/ControlbarComponentV4.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/view/components/ControlbarLayoutManager.as (modified) (4 diffs)
-
src/com/longtailvideo/jwplayer/view/components/DockComponent.as (modified) (3 diffs)
-
src/com/longtailvideo/jwplayer/view/components/PlaylistComponent.as (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fl5/src/com/longtailvideo/jwplayer/media/RTMPMediaProvider.as
r1280 r1282 188 188 /** Bandwidth and Framedrop checking for dynamic streaming. **/ 189 189 private function getStreamInfo():void { 190 var bwd:Number = Math.round(_stream.info.maxBytesPerSecond * 8 / 1024); 191 var drf:Number = _stream.info.droppedFrames; 192 _streamInfo.push({bwd:bwd,drf:drf}); 193 var len:Number = _streamInfo.length; 194 if(len > 5) { 195 bwd = Math.round((_streamInfo[len-1].bwd + _streamInfo[len-2].bwd + _streamInfo[len-3].bwd + 196 _streamInfo[len-4].bwd+ + _streamInfo[len-5].bwd)/5); 197 drf = Math.round((_streamInfo[len-1].drf - _streamInfo[len-5].drf)*2)/10; 198 if(item.levels.length > 0 && item.getLevel(bwd,config.width) != item.currentLevel) { 199 Logger.log("swapping to another level b/c of bandwidth",bwd.toString()); 200 swap(item.getLevel(bwd, config.width)); 201 } 202 if(item.levels.length > 0 && drf > 7 && item.currentLevel < item.levels.length-1) { 203 var lvl:Number = item.currentLevel; 204 item.blacklistLevel(lvl); 205 setTimeout(unBlacklist,30000,lvl); 206 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_META, {metadata: {type:'blacklist',level:lvl,state:true}}); 207 Logger.log("swapping to another level b/c of framedrops",drf.toString()); 208 swap(item.getLevel(bwd, config.width)); 209 } 210 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_META, {metadata: {bandwidth:bwd,droppedFrames:drf}}); 190 if (!_stream) { 191 clearInterval(_streamInfoInterval); 192 return; 193 } 194 try { 195 var bwd:Number = Math.round(_stream.info.maxBytesPerSecond * 8 / 1024); 196 var drf:Number = _stream.info.droppedFrames; 197 _streamInfo.push({bwd:bwd,drf:drf}); 198 var len:Number = _streamInfo.length; 199 if(len > 5) { 200 bwd = Math.round((_streamInfo[len-1].bwd + _streamInfo[len-2].bwd + _streamInfo[len-3].bwd + 201 _streamInfo[len-4].bwd+ + _streamInfo[len-5].bwd)/5); 202 drf = Math.round((_streamInfo[len-1].drf - _streamInfo[len-5].drf)*2)/10; 203 if(item.levels.length > 0 && item.getLevel(bwd,config.width) != item.currentLevel) { 204 Logger.log("swapping to another level b/c of bandwidth",bwd.toString()); 205 swap(item.getLevel(bwd, config.width)); 206 } 207 if(item.levels.length > 0 && drf > 7 && item.currentLevel < item.levels.length-1) { 208 var lvl:Number = item.currentLevel; 209 item.blacklistLevel(lvl); 210 setTimeout(unBlacklist,30000,lvl); 211 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_META, {metadata: {type:'blacklist',level:lvl,state:true}}); 212 Logger.log("swapping to another level b/c of framedrops",drf.toString()); 213 swap(item.getLevel(bwd, config.width)); 214 } 215 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_META, {metadata: {bandwidth:bwd,droppedFrames:drf}}); 216 } 217 } catch(e:Error) { 218 Logger.log("There was an error attempting to get stream info: " + e.message); 211 219 } 212 220 }; … … 603 611 } 604 612 break; 605 case 'NetConnection.Connect.Failed': 606 stop(); 613 case 'NetConnection.Connect.Closed': 614 stop(); 615 break; 616 case 'NetConnection.Connect.Failed': 617 stop(); 607 618 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_ERROR, {message: "Server not found: " + item.streamer}); 608 break;619 break; 609 620 case 'NetStream.Play.UnpublishNotify': 610 621 stop(); -
trunk/fl5/src/com/longtailvideo/jwplayer/player/JavascriptAPI.as
r1270 r1282 274 274 275 275 protected function js_getPlaylist():Array { 276 return JavascriptSerialization.playlistToArray(_player.playlist); 276 var playlistArray:Array = JavascriptSerialization.playlistToArray(_player.playlist); 277 for (var i:Number=0; i < playlistArray.length; i++) { 278 playlistArray[i] = JavascriptSerialization.stripDots(playlistArray[i]); 279 } 280 return playlistArray; 277 281 } 278 282 -
trunk/fl5/src/com/longtailvideo/jwplayer/player/JavascriptCompatibilityAPI.as
r1246 r1282 129 129 130 130 private function getJSPluginConfig(pluginId:String):Object { 131 return _player.config.pluginConfig(pluginId);131 return JavascriptSerialization.stripDots(_player.config.pluginConfig(pluginId)); 132 132 } 133 133 -
trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerVersion.as
r1280 r1282 3 3 4 4 public class PlayerVersion { 5 protected static var _version:String = "5.3.12 79";5 protected static var _version:String = "5.3.1282"; 6 6 7 7 public static function get version():String { -
trunk/fl5/src/com/longtailvideo/jwplayer/utils/JavascriptSerialization.as
r1228 r1282 47 47 } 48 48 49 return stripDots(obj);49 return obj; 50 50 } 51 51 -
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/ComponentButton.as
r998 r1282 19 19 20 20 21 protected static var currentTabIndex:Number = 100; 22 21 23 public function ComponentButton () { 24 this.tabEnabled = true; 25 this.tabChildren = false; 26 this.tabIndex = currentTabIndex++; 27 this.buttonMode = true; 22 28 } 23 29 -
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/ControlbarComponent.as
r1268 r1282 15 15 import com.longtailvideo.jwplayer.view.interfaces.IControlbarComponent; 16 16 17 import flash.accessibility.AccessibilityProperties; 17 18 import flash.display.DisplayObject; 18 19 import flash.display.MovieClip; … … 470 471 button.setOverIcon(getSkinElement(name + "ButtonOver")); 471 472 button.setBackground(getSkinElement(name + "ButtonBack")); 472 button.tabEnabled = true;473 473 button.clickFunction = function():void { 474 474 forward(new ViewEvent(event, eventData)); … … 564 564 565 565 private function addButtonDisplayObject(icon:DisplayObject, name:String, handler:Function=null):MovieClip { 566 var acs:AccessibilityProperties = new AccessibilityProperties(); 567 acs.name = name + 'Button'; 566 568 if (icon is ComponentButton) { 567 569 icon.name = name; 568 570 _buttons[name] = icon; 571 icon.accessibilityProperties = acs; 569 572 return icon as ComponentButton; 570 573 } else if (icon) { … … 574 577 } 575 578 clipMC.name = name; 579 clipMC.accessibilityProperties = acs; 576 580 clipMC.addChild(icon); 577 581 _buttons[name] = clipMC; … … 585 589 } 586 590 587 588 591 public function addButton(icon:DisplayObject, name:String, handler:Function=null):MovieClip { 589 592 if (_customButtons.indexOf(name) < 0) { … … 725 728 for each(var fieldName:String in ['elapsed','duration']) { 726 729 var textContainer:Sprite = getButton(fieldName) as Sprite; 730 textContainer.tabEnabled = false; 731 textContainer.buttonMode = false; 727 732 var textField:DisplayObject = textContainer.getChildByName('text'); 728 733 var textBackground:DisplayObject = textContainer.getChildByName('back'); -
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/ControlbarComponentV4.as
r1268 r1282 83 83 skin.x = 0; 84 84 skin.y = 0; 85 skin.tabChildren = t rue;86 skin.tabEnabled = false;85 skin.tabChildren = this.tabChildren = true; 86 skin.tabEnabled = this.tabEnabled = false; 87 87 addChild(skin); 88 88 _player.addEventListener(PlayerStateEvent.JWPLAYER_PLAYER_STATE, stateHandler); -
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/ControlbarLayoutManager.as
r993 r1282 2 2 import flash.display.DisplayObject; 3 3 import flash.display.DisplayObjectContainer; 4 import flash.display.Sprite; 4 5 import flash.text.TextField; 5 6 … … 11 12 protected var _height:Number; 12 13 14 protected var _tabLeft:Number; 15 protected var _tabRight:Number; 13 16 14 17 public function ControlbarLayoutManager(controlbar:ControlbarComponent) { … … 30 33 var controlbarPattern:RegExp = /\[(.*)\]\[(.*)\]\[(.*)\]/; 31 34 var result:Object = controlbarPattern.exec(_controlbar.layout); 35 36 _tabLeft = 300; 37 _tabRight = 399; 38 32 39 position(result[1], "left"); 33 40 position(result[3], "right"); … … 70 77 71 78 private function place(displayObject:DisplayObject, align:String):void { 79 var displayObjectSprite:Sprite = displayObject as Sprite; 72 80 if (align == "left") { 81 if (displayObjectSprite && displayObjectSprite.buttonMode) { 82 displayObjectSprite.tabIndex = _tabLeft++; 83 } 73 84 placeLeft(displayObject); 74 85 } else if (align == "right") { 86 if (displayObjectSprite && displayObjectSprite.buttonMode) { 87 displayObjectSprite.tabIndex = _tabRight--; 88 } 75 89 placeRight(displayObject); 76 90 } -
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/DockComponent.as
r1054 r1282 8 8 import com.longtailvideo.jwplayer.view.skins.SWFSkin; 9 9 10 import flash.accessibility.AccessibilityProperties; 10 11 import flash.display.DisplayObject; 11 12 import flash.display.MovieClip; … … 27 28 /** Reference to the animations handler **/ 28 29 private var animations:Animations; 30 /** Tab index for accessibility options **/ 31 private var currentTab:Number = 400; 29 32 30 33 public function DockComponent(player:IPlayer) { … … 49 52 button.colorize = true; 50 53 } 54 var acs:AccessibilityProperties = new AccessibilityProperties(); 55 acs.name = (name ? name : icon.name) + "Button"; 56 button.accessibilityProperties = acs; 57 button.tabEnabled = true; 58 button.tabChildren = false; 59 button.tabIndex = currentTab++; 51 60 button.setOutIcon(icon); 52 61 button.outBackground = getSkinElement("button") as Sprite; -
trunk/fl5/src/com/longtailvideo/jwplayer/view/components/PlaylistComponent.as
r1280 r1282 20 20 import com.longtailvideo.jwplayer.view.skins.SWFSkin; 21 21 22 import flash.accessibility.AccessibilityProperties; 22 23 import flash.display.Bitmap; 23 24 import flash.display.DisplayObject; … … 436 437 } 437 438 } 439 var currentTab:Number=500; 438 440 for (var i:Number = 0; i < _player.playlist.length; i++) { 439 441 if (clr) { … … 445 447 list.addChild(btn); 446 448 } 449 btn.tabEnabled = true; 450 btn.tabChildren = false; 451 btn.tabIndex = currentTab++; 447 452 var stc:Stacker = new Stacker(btn); 448 453 btn.y = i * buttonheight; … … 543 548 private function setContents(idx:Number):void { 544 549 var playlistItem:PlaylistItem = _player.playlist.getItemAt(idx); 545 var title:TextField = getButton(idx).getChildByName("title") as TextField; 546 var description:TextField = getButton(idx).getChildByName("description") as TextField; 547 var duration:TextField = getButton(idx).getChildByName("duration") as TextField; 548 var author:TextField = getButton(idx).getChildByName("author") as TextField; 549 var tags:TextField = getButton(idx).getChildByName("tags") as TextField; 550 var btn:Sprite = getButton(idx); 551 var title:TextField = btn.getChildByName("title") as TextField; 552 var description:TextField = btn.getChildByName("description") as TextField; 553 var duration:TextField = btn.getChildByName("duration") as TextField; 554 var author:TextField = btn.getChildByName("author") as TextField; 555 var tags:TextField = btn.getChildByName("tags") as TextField; 550 556 if (playlistItem.image || playlistItem['playlist.image']) { 551 557 var imageFile:String = playlistItem['playlist.image'] ? playlistItem['playlist.image'] : playlistItem.image; 552 558 if (getConfigParam('thumbs') != false && _player.config.playlist != 'none' && buttonheight > 39 && getConfigParam("width") > 239) { 553 var img:Sprite = getButton(idx).getChildByName("image") as Sprite;559 var img:Sprite = btn.getChildByName("image") as Sprite; 554 560 if (img) { 555 561 img.alpha = 0; … … 575 581 } 576 582 try { 583 var acs:AccessibilityProperties = new AccessibilityProperties(); 584 acs.name = playlistItem.title; 585 acs.description = playlistItem.description; 586 btn.accessibilityProperties = acs; 577 587 if (description) { 578 588 description.htmlText = playlistItem.description; … … 600 610 } catch (e:Error) { 601 611 } 602 img = getButton(idx).getChildByName("image") as MovieClip;612 img = btn.getChildByName("image") as MovieClip; 603 613 if (img && (!(playlistItem.image || playlistItem['playlist.image']) || getConfigParam('thumbs') == false || buttonheight < 40 || getConfigParam("width") < 240)) { 604 614 if (!img.getChildByName("imageBackground")) { 605 getButton(idx).getChildByName("image").visible = false;615 btn.getChildByName("image").visible = false; 606 616 } 607 617 } 608 618 if (back && swfSkinned) { 609 getButton(idx).getChildByName("back").transform.colorTransform = back;619 btn.getChildByName("back").transform.colorTransform = back; 610 620 } 611 621 }
Note: See TracChangeset
for help on using the changeset viewer.
