- Timestamp:
- 10/15/09 18:21:56 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fl5/src/com/longtailvideo/jwplayer/model/PlayerConfig.as
r467 r475 14 14 public dynamic class PlayerConfig extends EventDispatcher { 15 15 /** Internal playlist reference **/ 16 private var _list:Playlist; 16 // private var _list:Playlist; 17 private var _singleItem:PlaylistItem; 17 18 18 19 private var _playlistfile:String = null; … … 52 53 private var _playerready:String = ""; 53 54 54 public function PlayerConfig( newlist:Playlist):void {55 public function PlayerConfig():void { 55 56 controlbar = _controlbar; 56 57 playlist = _playlist; 57 58 playlistsize = _playlistsize; 58 setPlaylist(newlist); 59 // _list = newlist; 60 // setPlaylist(newlist); 59 61 60 62 //Unsupported config variables … … 62 64 } 63 65 66 /* 64 67 public function setPlaylist(list:Playlist):void { 65 68 _list = list; 66 69 } 67 70 */ 68 71 public function setConfig(config:Object):void { 69 var newItem:PlaylistItem = new PlaylistItem();70 72 var playlistItems:Boolean = false; 73 if (!_singleItem) { _singleItem = new PlaylistItem(); } 71 74 for (var item:String in config) { 72 if ( newItem.hasOwnProperty(item)) {75 if (_singleItem.hasOwnProperty(item)) { 73 76 if (item == "file" && Strings.extension(config[item]) == "xml") { 74 77 setProperty("playlistfile", config[item]); 75 }else if (_list.length > 0) {76 _list.currentItem[item] = config[item];78 // } //else if (_list.length > 0) { 79 // _list.currentItem[item] = config[item]; 77 80 } else { 78 newItem[item] = config[item];81 _singleItem[item] = config[item]; 79 82 playlistItems = true; 80 83 } … … 85 88 } 86 89 } 87 if (playlistItems && _list.length == 0) {88 _list.insertItem(newItem, 0);89 }90 // if (playlistItems && _list.length == 0) { 91 // _list.insertItem(newItem, 0); 92 // } 90 93 } 91 94 … … 125 128 private function playlistItem(key:String):String { 126 129 try { 127 return _list.currentItem[key].toString(); 130 // return _list.currentItem[key].toString(); 131 return _singleItem[key].toString(); 128 132 } catch (e:Error) { 129 133 } … … 195 199 public function get type():String { return playlistItem('provider'); } 196 200 201 /** PlaylistItem representing single-item playlist based on flashvars (e.g. config[file], config[image], etc. **/ 202 public function get singleItem():PlaylistItem { return _singleItem; } 203 197 204 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// 198 205 // LAYOUT PROPERTIES
Note: See TracChangeset
for help on using the changeset viewer.
