Changeset 1806
- Timestamp:
- 05/26/11 14:29:28 (2 years ago)
- Location:
- plugins/hd/v5
- Files:
-
- 2 edited
-
hd.swf (modified) (previous)
-
src/com/longtailvideo/plugins/hd/HD.as (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/hd/v5/src/com/longtailvideo/plugins/hd/HD.as
r1801 r1806 12 12 import com.longtailvideo.jwplayer.plugins.PluginConfig; 13 13 import com.longtailvideo.jwplayer.utils.Configger; 14 14 15 15 import flash.display.DisplayObject; 16 16 import flash.display.MovieClip; … … 119 119 // Reset the reset. 120 120 _reset = -1; 121 // Set the file flashvar to the first playlistitem. 122 if(_config.file) { 123 _player.playlist.getItemAt(0)['hd.file'] = _config.file; 124 } 121 // Which item should we apply the global 'hd.file' to? 122 // We should skip ova.hidden items. 123 var firstVisible:Number = 0; 125 124 // Store all the original files into the playlist. 126 125 for(var i:Number = 0; i < _player.playlist.length; i++) { 127 126 var item:PlaylistItem = _player.playlist.getItemAt(i); 127 if (item['ova.hidden']) { 128 // This item is hidden by OVA; we shouldn't set its hd.file property. 129 firstVisible++; 130 } 131 // Set the hd.file flashvar to the first playlistitem. 132 if(i == firstVisible && _config.file) { 133 item['hd.file'] = _config.file; 134 } 128 135 if(item.provider == 'youtube') { 129 136 item['youtube.quality'] = 'medium'; … … 186 193 /** Switch the currently playing file with a new one. **/ 187 194 private function _swap():void { 188 // Swap HD state in every playlist item. 189 for(var i:Number = 0; i<_player.playlist.length; i++) { 190 var item:PlaylistItem = _player.playlist.getItemAt(i); 191 if (item.provider == 'youtube') { 192 if(_config.state) { 193 item['youtube.quality'] = 'hd720'; 194 } else { 195 item['youtube.quality'] = 'medium'; 196 } 197 198 } else if(item['hd.file']) { 199 if(_config.state) { 200 item.file = item['hd.file']; 201 } else { 202 item.file = item['hd.original']; 203 } 204 } 205 } 195 // Swap HD state in every playlist item. 196 for(var i:Number = 0; i<_player.playlist.length; i++) { 197 var item:PlaylistItem = _player.playlist.getItemAt(i); 198 if (!item['ova.hidden']) { 199 if (item.provider == 'youtube') { 200 if(_config.state) { 201 item['youtube.quality'] = 'hd720'; 202 } else { 203 item['youtube.quality'] = 'medium'; 204 } 205 206 } else if(item['hd.file']) { 207 if(_config.state) { 208 item.file = item['hd.file']; 209 } else { 210 item.file = item['hd.original']; 211 } 212 } 213 } 214 } 206 215 // Restart player if not IDLE. 207 216 if(_player.state != PlayerState.IDLE) {
Note: See TracChangeset
for help on using the changeset viewer.
