Changeset 853
- Timestamp:
- 02/24/10 16:29:52 (3 years ago)
- Location:
- branches/plugins/hd
- Files:
-
- 2 edited
-
bin-release/hd.swf (modified) (previous)
-
src/com/longtailvideo/plugins/hd/HD.as (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugins/hd/src/com/longtailvideo/plugins/hd/HD.as
r852 r853 50 50 _player = player; 51 51 _config = cfg; 52 if (config.state == 'true') {52 if (config.state.toString() == 'true') { 53 53 config.state = true; 54 54 } else { … … 57 57 _player.addEventListener(MediaEvent.JWPLAYER_MEDIA_TIME, timeHandler); 58 58 _player.addEventListener(PlaylistEvent.JWPLAYER_PLAYLIST_ITEM, itemHandler); 59 if (config.state) { 60 config.file = config.file; 61 } 59 62 60 if (_player.config.dock) { 63 61 if (_player.skin.getSkinElement('hd', 'dockIcon')) { … … 139 137 /** Updates the playlist with either the HD or default video. **/ 140 138 private function itemHandler(evt:Event=null):void { 141 if (_currentItem != _player.playlist.currentItem) { 139 if (_currentItem == null && config.state) { 140 // Little hack to avoid re-loading the playlist on startup. 141 _currentItem = _player.playlist.currentItem; 142 _currentItem['hd.originalfile'] = _currentItem.file; 143 _currentItem.file = swapFile; 144 } else if (_currentItem != _player.playlist.currentItem) { 142 145 _currentItem = _player.playlist.currentItem; 143 146 } … … 165 168 // Load a new playlist instead of changing the item's file property. 166 169 // This is necessary due to a bug in 5.0 that doesn't load a new file if the PlaylistItem object doesn't change. 167 _player.load(newList); 168 _player.play(); 169 _player.seek(_position); 170 if (_player.state == PlayerState.PLAYING || _player.state == PlayerState.BUFFERING) { 171 _player.load(newList); 172 _player.play(); 173 _player.seek(_position); 174 } else { 175 _player.load(newList); 176 } 170 177 } 171 178
Note: See TracChangeset
for help on using the changeset viewer.
