Changeset 796
- Timestamp:
- 01/14/10 12:55:31 (3 years ago)
- Location:
- trunk/fl5
- Files:
-
- 6 edited
-
player.swf (modified) (previous)
-
src/com/longtailvideo/jwplayer/media/MediaProvider.as (modified) (19 diffs)
-
src/com/longtailvideo/jwplayer/media/RTMPMediaProvider.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/player/PlayerVersion.as (modified) (1 diff)
-
yt.as (modified) (6 diffs)
-
yt.swf (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fl5/src/com/longtailvideo/jwplayer/media/MediaProvider.as
r764 r796 14 14 import flash.events.Event; 15 15 16 16 17 /** 17 18 * Fired when a portion of the current media has been loaded into the buffer. … … 33 34 [Event(name="jwplayerMediaError", type="com.longtailvideo.jwplayer.events.MediaEvent")] 34 35 /** 35 * Fired after the MediaProvider has loaded an item into memory.36 * Fired after the MediaProvider has successfully set up a connection to the media. 36 37 * 37 38 * @eventType com.longtailvideo.jwplayer.events.MediaEvent.JWPLAYER_MEDIA_LOADED … … 39 40 [Event(name="jwplayerMediaLoaded", type="com.longtailvideo.jwplayer.events.MediaEvent")] 40 41 /** 41 * Sen t after a load() command has completed42 * Sends the position and duration of the currently playing media. 42 43 * 43 44 * @eventType com.longtailvideo.jwplayer.events.MediaEvent.JWPLAYER_MEDIA_TIME … … 45 46 [Event(name="jwplayerMediaTime", type="com.longtailvideo.jwplayer.events.MediaEvent")] 46 47 /** 47 * Sends the position and duration of the currently playing media48 * Fired after a volume change. 48 49 * 49 50 * @eventType com.longtailvideo.jwplayer.events.MediaEvent.JWPLAYER_MEDIA_VOLUME … … 51 52 [Event(name="jwplayerMediaVolume", type="com.longtailvideo.jwplayer.events.MediaEvent")] 52 53 /** 53 * Fired when the currently playing media has completed its playback 54 * Fired when the currently playing media has completed its playback. 54 55 * 55 56 * @eventType com.longtailvideo.jwplayer.events.MediaEvent.JWPLAYER_MEDIA_COMPLETE … … 62 63 */ 63 64 [Event(name="jwplayerPlayerState", type="com.longtailvideo.jwplayer.events.PlayerStateEvent")] 64 65 65 66 public class MediaProvider extends Sprite implements IGlobalEventDispatcher { 66 67 /** Reference to the player configuration. **/ … … 82 83 /** Handles event dispatching **/ 83 84 private var _dispatcher:GlobalEventDispatcher; 84 85 85 86 protected var _width:Number; 86 87 protected var _height:Number; 87 88 88 89 89 90 public function MediaProvider(provider:String) { 90 91 _provider = provider; 91 92 _dispatcher = new GlobalEventDispatcher(); 92 93 } 93 94 94 95 95 96 public function initializeMediaProvider(cfg:PlayerConfig):void { 96 97 _config = cfg; 97 98 _state = PlayerState.IDLE; 98 99 } 99 100 100 101 101 102 /** 102 103 * Load a new playlist item … … 107 108 dispatchEvent(new MediaEvent(MediaEvent.JWPLAYER_MEDIA_LOADED)); 108 109 } 109 110 111 /** Pause playback of the item. **/ 112 public function pause():void { 113 setState(PlayerState.PAUSED); 114 } 115 116 110 111 117 112 /** Resume playback of the item. **/ 118 113 public function play():void { … … 122 117 } 123 118 } 124 125 119 120 121 /** Pause playback of the item. **/ 122 public function pause():void { 123 setState(PlayerState.PAUSED); 124 } 125 126 126 127 /** 127 128 * Seek to a certain position in the item. … … 132 133 _position = pos; 133 134 } 134 135 135 136 136 137 /** Stop playing and loading the item. **/ 137 138 public function stop():void { … … 142 143 } 143 144 } 144 145 145 146 146 147 /** 147 148 * Change the playback volume of the item. … … 152 153 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_VOLUME, {'volume': vol}); 153 154 } 154 155 155 156 156 157 /** 157 158 * Changes the mute state of the item. … … 163 164 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_MUTE, {'mute': mute}); 164 165 } 165 166 167 /** Completes video playback **/ 168 protected function complete():void { 169 stop(); 170 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_COMPLETE); 171 } 172 173 174 /** Puts the video into a buffer state **/ 175 protected function buffer():void { 176 177 } 178 179 180 /** Graphical representation of media **/ 181 public function get display():DisplayObject { 182 return _media; 183 } 184 185 186 /** Name of the MediaProvider. */ 187 public function get provider():String { 188 return _provider; 189 } 190 191 192 /** 193 * Current state of the MediaProvider. 194 * @see PlayerStates 195 */ 196 public function get state():String { 197 return _state; 198 } 199 200 201 /** Currently playing PlaylistItem **/ 202 public function get item():PlaylistItem { 203 return _item; 204 } 205 206 207 /** Current position, in seconds **/ 208 public function get position():Number { 209 return _position; 210 } 211 212 213 /** 214 * The current volume of the playing media 215 * <p>Range: 0-100</p> 216 */ 217 public function get volume():Number { 218 return _volume; 219 } 220 221 222 /** 223 * The current config 224 */ 225 protected function get config():PlayerConfig { 226 return _config; 227 } 228 229 166 167 230 168 /** 231 169 * Resizes the display. … … 241 179 } 242 180 } 243 244 181 182 183 /** Graphical representation of media **/ 184 public function get display():DisplayObject { 185 return _media; 186 } 187 188 189 /** Name of the MediaProvider. */ 190 public function get provider():String { 191 return _provider; 192 } 193 194 195 /** 196 * Current state of the MediaProvider. 197 * @see PlayerStates 198 */ 199 public function get state():String { 200 return _state; 201 } 202 203 204 /** Currently playing PlaylistItem **/ 205 public function get item():PlaylistItem { 206 return _item; 207 } 208 209 210 /** Current position, in seconds **/ 211 public function get position():Number { 212 return _position; 213 } 214 215 216 /** 217 * The current volume of the playing media 218 * <p>Range: 0-100</p> 219 */ 220 public function get volume():Number { 221 return _volume; 222 } 223 224 225 /** Puts the video into a buffer state **/ 226 protected function buffer():void { 227 228 } 229 230 231 /** Completes video playback **/ 232 protected function complete():void { 233 stop(); 234 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_COMPLETE); 235 } 236 237 238 /** Dispatches error notifications **/ 239 protected function error(message:String):void { 240 stop(); 241 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_ERROR, {message: message}); 242 } 243 244 245 245 /** 246 246 * Sets the current state to a new state and sends a PlayerStateEvent … … 254 254 } 255 255 } 256 257 256 257 258 258 /** 259 259 * Sends a MediaEvent, simultaneously setting a property … … 271 271 dispatchEvent(newEvent); 272 272 } 273 274 273 274 275 275 /** Dispatches buffer change notifications **/ 276 276 protected function sendBufferEvent(bufferPercent:Number, offset:Number=0):void { … … 278 278 _bufferPercent = bufferPercent; 279 279 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_BUFFER, {'bufferPercent': _bufferPercent, 280 'offset': offset, 'duration': _item.duration}); 281 } 282 } 283 284 285 /** Dispatches error notifications **/ 286 protected function error(message:String):void { 287 stop(); 288 sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_ERROR, {message: message}); 289 } 290 291 280 'offset': offset, 'duration': _item.duration}); 281 } 282 } 283 284 285 /** 286 * The current config 287 */ 288 protected function get config():PlayerConfig { 289 return _config; 290 } 291 292 292 293 /** 293 294 * Gets a property from the player configuration … … 298 299 return _config.pluginConfig(provider)[property]; 299 300 } 300 301 302 /////////////////////////////////////////// 303 /// IGlobalEventDispatcher implementation 304 /////////////////////////////////////////// 305 /** 306 * @inheritDoc 307 */ 308 public function addGlobalListener(listener:Function):void { 309 _dispatcher.addGlobalListener(listener); 310 } 311 312 313 /** 314 * @inheritDoc 315 */ 316 public function removeGlobalListener(listener:Function):void { 317 _dispatcher.removeGlobalListener(listener); 318 } 319 320 321 /** 322 * @inheritDoc 323 */ 324 public override function dispatchEvent(event:Event):Boolean { 325 _dispatcher.dispatchEvent(event); 326 return super.dispatchEvent(event); 327 } 328 329 301 302 /** 303 * Gets the graphical representation of the media. 304 * 305 */ 306 protected function get media():DisplayObject { 307 return _media; 308 } 309 310 311 /** 312 * Sets the graphical representation of the media. 313 * 314 */ 330 315 protected function set media(m:DisplayObject):void { 331 316 if (m) { … … 340 325 } 341 326 } 342 343 344 protected function get media():DisplayObject { 345 return _media; 327 328 329 /////////////////////////////////////////// 330 /// IGlobalEventDispatcher implementation 331 /////////////////////////////////////////// 332 /** 333 * @inheritDoc 334 */ 335 public function addGlobalListener(listener:Function):void { 336 _dispatcher.addGlobalListener(listener); 337 } 338 339 340 /** 341 * @inheritDoc 342 */ 343 public function removeGlobalListener(listener:Function):void { 344 _dispatcher.removeGlobalListener(listener); 345 } 346 347 348 /** 349 * @inheritDoc 350 */ 351 public override function dispatchEvent(event:Event):Boolean { 352 _dispatcher.dispatchEvent(event); 353 return super.dispatchEvent(event); 346 354 } 347 355 } -
trunk/fl5/src/com/longtailvideo/jwplayer/media/RTMPMediaProvider.as
r765 r796 80 80 if (ext == '.mp3') { 81 81 return 'mp3:' + url.substr(0, url.length - 4); 82 } else if (ext == '.mp4' || ext == '.mov' || ext == '.aac' || ext == '.m4a' || ext == '.f4v' ) {82 } else if (ext == '.mp4' || ext == '.mov' || ext == '.aac' || ext == '.m4a' || ext == '.f4v' || ext == '.m4v') { 83 83 return 'mp4:' + url; 84 84 } else if (ext == '.flv') { -
trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerVersion.as
r781 r796 3 3 4 4 public class PlayerVersion { 5 protected static var _version:String = "5.1.7 81";5 protected static var _version:String = "5.1.796"; 6 6 7 7 public static function get version():String { -
trunk/fl5/yt.as
r512 r796 2 2 System.security.allowDomain('*'); 3 3 System.security.allowInsecureDomain('*'); 4 5 4 6 5 … … 14 13 _as3_to_as2.allowDomain('*'); 15 14 _as2_to_as3.allowDomain('*'); 15 16 16 var connection:String; 17 17 var loadInterval:Number; … … 20 20 var loaded:Number; 21 21 var position:Number; 22 22 var GlobalSound = new Sound(ytPlayer); 23 23 24 24 … … 31 31 ytPlayer.addEventListener("onError", onPlayerError); 32 32 ytPlayer.unMute(); 33 ytPlayer.setVolume(100); 33 34 } 34 35 }; … … 36 37 var btl = ytPlayer.getVideoBytesLoaded(); 37 38 var ttl = ytPlayer.getVideoBytesTotal(); 38 var off = ytPlayer.getVideoStartBytes();39 var off = ytPlayer.getVideoStartBytes(); 39 40 if(ttl > 10 && btl != loaded) { 40 41 loaded = btl; … … 82 83 _as3_to_as2.playVideo = function() { ytPlayer.playVideo(); }; 83 84 _as3_to_as2.stopVideo = function(){ ytPlayer.stopVideo(); clearInterval(byteInterval); }; 84 _as3_to_as2.loadVideoById = function(id,pos) { ytPlayer.loadVideoById(id,pos); };85 _as3_to_as2.loadVideoById = function(id,pos) {ytPlayer.stopVideo(); ytPlayer.loadVideoById(id,pos); }; 85 86 _as3_to_as2.cueVideoById = function(id,pos) { ytPlayer.cueVideoById(id,pos); }; 86 _as3_to_as2.setVolume = function(vol) { ytPlayer.setVolume( vol);};87 _as3_to_as2.setVolume = function(vol) { ytPlayer.setVolume(100); GlobalSound.setVolume(vol) }; 87 88 _as3_to_as2.seekTo = function(pos) { ytPlayer.seekTo(pos,true); }; 88 89 _as3_to_as2.setSize = function(wid,hei) { ytPlayer.setSize(wid,hei); };
Note: See TracChangeset
for help on using the changeset viewer.
