Changeset 542
- Timestamp:
- 10/28/09 19:12:15 (4 years ago)
- Location:
- trunk/fl5
- Files:
-
- 1 deleted
- 9 edited
-
player.swf (modified) (previous)
-
src/com/longtailvideo/jwplayer/controller/Controller.as (modified) (4 diffs)
-
src/com/longtailvideo/jwplayer/controller/StretchingOptions.as (deleted)
-
src/com/longtailvideo/jwplayer/media/MediaProvider.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/media/SoundMediaProvider.as (modified) (2 diffs)
-
src/com/longtailvideo/jwplayer/media/VideoMediaProvider.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/model/PlayerConfig.as (modified) (4 diffs)
-
src/com/longtailvideo/jwplayer/model/PlaylistItem.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/player/Player.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/utils/Stretcher.as (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fl5/src/com/longtailvideo/jwplayer/controller/Controller.as
r540 r542 134 134 135 135 private function playlistLoadHandler(evt:PlaylistEvent=null):void { 136 var loadIndex:Number = _model.config.item;137 136 if (_model.config.shuffle) { 138 loadIndex = Math.floor(Math.random() * _model.playlist.length); 139 } 140 _model.playlist.currentIndex = loadIndex; 137 shuffleItem(); 138 } else { 139 _model.playlist.currentIndex = _model.config.item; 140 } 141 141 142 if (_player.config.autostart) { 142 load(loadIndex); 143 } 143 load(_model.playlist.currentItem); 144 } 145 } 146 147 private function shuffleItem():void { 148 _model.playlist.currentIndex = Math.floor(Math.random() * _model.playlist.length); 144 149 } 145 150 … … 157 162 158 163 private function completeHandler(evt:MediaEvent):void { 159 164 switch (_model.config.repeat) { 165 case RepeatOptions.SINGLE: 166 play(); 167 break; 168 case RepeatOptions.ALWAYS: 169 if (_model.playlist.currentIndex == _model.playlist.length-1 && !_model.config.shuffle) { 170 _model.playlist.currentIndex = 0; 171 play(); 172 } else { 173 next(); 174 } 175 break; 176 case RepeatOptions.LIST: 177 if (_model.playlist.currentIndex == _model.playlist.length-1 && !_model.config.shuffle) { 178 _model.playlist.currentIndex = 0; 179 } else { 180 next(); 181 } 182 break; 183 } 160 184 } 161 185 … … 219 243 if (_model.playlist.currentItem) { 220 244 switch (_player.state) { 221 case PlayerState.BUFFERING:222 case PlayerState.PLAYING:223 _model.media.stop();224 245 case PlayerState.IDLE: 225 246 load(_model.playlist.currentItem); 226 247 break; 248 case PlayerState.BUFFERING: 249 case PlayerState.PLAYING: 250 _model.media.seek(_model.playlist.currentItem.start); 227 251 case PlayerState.PAUSED: 228 252 _model.media.play(); … … 265 289 266 290 public function next():Boolean { 267 if (_model.playlist.currentIndex == _model.playlist.length-1) { 291 if (_model.config.shuffle) { 292 shuffleItem(); 293 play(); 294 return true; 295 } else if (_model.playlist.currentIndex == _model.playlist.length-1) { 268 296 return false; 269 297 } else { -
trunk/fl5/src/com/longtailvideo/jwplayer/media/MediaProvider.as
r540 r542 164 164 /** Completes video playback **/ 165 165 protected function complete():void { 166 stop(); 166 167 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_COMPLETE); 167 stop();168 168 } 169 169 -
trunk/fl5/src/com/longtailvideo/jwplayer/media/SoundMediaProvider.as
r529 r542 88 88 override public function pause():void { 89 89 if (channel){ 90 clearInterval(positionInterval); 91 positionInterval = undefined; 90 92 channel.stop(); 91 93 } … … 139 141 /** Seek in the sound. **/ 140 142 override public function seek(pos:Number):void { 141 if (sound && (pos >=(sound.bytesLoaded / sound.bytesTotal) * item.duration)) {143 if (sound && (pos < (sound.bytesLoaded / sound.bytesTotal) * item.duration)) { 142 144 clearInterval(positionInterval); 143 145 positionInterval = undefined; -
trunk/fl5/src/com/longtailvideo/jwplayer/media/VideoMediaProvider.as
r529 r542 64 64 stream.checkPolicyFile = true; 65 65 stream.play(item.file); 66 } else { 67 seek(0); 66 68 } 67 69 positionInterval = setInterval(positionHandler, 200); -
trunk/fl5/src/com/longtailvideo/jwplayer/model/PlayerConfig.as
r540 r542 4 4 import com.longtailvideo.jwplayer.utils.Configger; 5 5 import com.longtailvideo.jwplayer.utils.Logger; 6 import com.longtailvideo.jwplayer.utils.Stretcher; 6 7 import com.longtailvideo.jwplayer.utils.Strings; 7 8 import com.longtailvideo.jwplayer.utils.TypeChecker; … … 32 33 private var _shuffle:Boolean = false; 33 34 private var _smoothing:Boolean = true; 34 private var _stretching:String = "uniform";35 private var _stretching:String = Stretcher.UNIFORM; 35 36 private var _volume:Number = 90; 36 37 … … 306 307 /** Set to list to play the entire playlist once, to always to continously play the song/video/playlist and to single to continue repeating the selected file in a playlist. @default none **/ 307 308 public function get repeat():String { return _repeat; } 308 public function set repeat(x:String):void { _repeat = x ; }309 public function set repeat(x:String):void { _repeat = x.toLowerCase(); } 309 310 310 311 /** Shuffle playback of playlist items. @default false **/ … … 318 319 /** Defines how to resize images in the display. Can be none (no stretching), exactfit (disproportionate), uniform (stretch with black borders) or fill (uniform, but completely fill the display). @default uniform **/ 319 320 public function get stretching():String{ return _stretching; } 320 public function set stretching(x:String):void { _stretching = x ; }321 public function set stretching(x:String):void { _stretching = x.toLowerCase(); } 321 322 322 323 /** Startup volume of the player. Can be 0 to 100. Is saved in a cookie. @default 90 **/ -
trunk/fl5/src/com/longtailvideo/jwplayer/model/PlaylistItem.as
r441 r542 15 15 public var link:String = ""; 16 16 public var mediaid:String = ""; 17 public var start:Number = -1;17 public var start:Number = 0; 18 18 public var streamer:String = ""; 19 19 public var tags:String = ""; -
trunk/fl5/src/com/longtailvideo/jwplayer/player/Player.as
r540 r542 30 30 */ 31 31 public class Player extends Sprite { 32 private static var playerVersion:String = "5.0.54 0alpha";32 private static var playerVersion:String = "5.0.541 alpha"; 33 33 private static var _commercial:Boolean = Boolean(CONFIG::commercial); 34 34 -
trunk/fl5/src/com/longtailvideo/jwplayer/utils/Stretcher.as
r397 r542 29 29 var ysc:Number = hei / clp.height; 30 30 switch (typ.toLowerCase()) { 31 case 'exactfit':31 case Stretcher.EXACTFIT: 32 32 clp.width = wid; 33 33 clp.height = hei; 34 34 break; 35 case 'fill':35 case Stretcher.FILL: 36 36 if (xsc > ysc) { 37 37 clp.width *= xsc; … … 42 42 } 43 43 break; 44 case 'none':44 case Stretcher.NONE: 45 45 clp.scaleX = 1; 46 46 clp.scaleY = 1; 47 47 break; 48 case 'uniform':48 case Stretcher.UNIFORM: 49 49 default: 50 50 if (xsc > ysc) {
Note: See TracChangeset
for help on using the changeset viewer.
