Changeset 1223


Ignore:
Timestamp:
08/18/10 18:52:22 (3 years ago)
Author:
pablo
Message:
  • Fixes issue with Sound MediaProvider where the lack of content-length headers cause instability (1012)
  • New JS API getters for width and height use stage dimensions instead of display window
Location:
trunk/fl5
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/fl5/src/com/longtailvideo/jwplayer/media/SoundMediaProvider.as

    r1135 r1223  
    88        import com.longtailvideo.jwplayer.model.PlaylistItem; 
    99        import com.longtailvideo.jwplayer.player.PlayerState; 
     10        import com.longtailvideo.jwplayer.utils.Logger; 
    1011         
    1112        import flash.events.*; 
     
    133134                /** Interval for the _position progress **/ 
    134135                protected function positionHandler(progressEvent:ProgressEvent=null):void { 
    135                         var bufferPercent:Number; 
    136                          
    137                         if (_sound.bytesTotal > 0 && _sound.bytesLoaded / _sound.bytesTotal > 0.1 && (_item.duration <= 0 || _userDuration < 0)) { 
    138                                 _item.duration = _sound.length / 1000 / _sound.bytesLoaded * _sound.bytesTotal; 
    139                         } 
    140                          
    141                         if (_channel && _sound && _sound.bytesTotal > 0) { 
     136                        var bufferPercent:Number = 0; 
     137                         
     138                        if (_item.duration <= 0 || _userDuration < 0) { 
     139                                if (_sound.bytesTotal > 0 && _sound.bytesLoaded / _sound.bytesTotal > 0.1) { 
     140                                        _item.duration = _sound.length / 1000 / _sound.bytesLoaded * _sound.bytesTotal; 
     141                                } else if (_sound.length > 0) { 
     142                                        _item.duration = _sound.length / 1000; 
     143                                } 
     144                        } 
     145                         
     146                        if (_channel && _sound) { 
    142147                                _position = Math.round(_channel.position / 100) / 10; 
    143                                 bufferPercent = Math.floor(_sound.bytesLoaded / _sound.bytesTotal * 100); 
     148                                if (_sound.bytesTotal > 0) { 
     149                                        bufferPercent = Math.floor(_sound.bytesLoaded / _sound.bytesTotal * 100); 
     150                                } 
    144151                        } else if (!_channel && progressEvent && progressEvent.bytesTotal > 0) { 
    145152                                bufferPercent = Math.floor(progressEvent.bytesLoaded / progressEvent.bytesTotal * 100); 
    146                         } else { 
    147                                 bufferPercent = 0; 
    148                         } 
    149                          
    150                         if (_sound.isBuffering == true && _sound.bytesTotal > _sound.bytesLoaded) { 
    151                                 if (state != PlayerState.BUFFERING) { 
    152                                         _bufferFull = false; 
    153                                         if (_channel) { 
    154                                                 _channel.stop(); 
    155                                         } 
    156                                         if (!progressEvent) { 
    157                                                 setState(PlayerState.BUFFERING); 
    158                                         } 
    159                                 } 
     153                        } 
     154 
     155                         
     156                        if (state == PlayerState.PLAYING && _sound.isBuffering == true) { 
     157                                // Buffer underrun condition 
     158                                _bufferFull = false; 
     159                                setState(PlayerState.BUFFERING); 
     160                                return 
    160161                        } else if (state == PlayerState.BUFFERING && _sound.bytesLoaded > 0 && !_bufferFull) { 
    161162                                _bufferFull = true; 
    162163                                sendMediaEvent(MediaEvent.JWPLAYER_MEDIA_BUFFER_FULL); 
    163164                        } 
    164                          
    165165                         
    166166                        if (!isNaN(bufferPercent) && !_bufferingComplete){ 
  • trunk/fl5/src/com/longtailvideo/jwplayer/player/JavascriptAPI.as

    r1214 r1223  
    88        import com.longtailvideo.jwplayer.utils.JavascriptSerialization; 
    99        import com.longtailvideo.jwplayer.utils.Logger; 
     10        import com.longtailvideo.jwplayer.utils.RootReference; 
    1011        import com.longtailvideo.jwplayer.utils.Strings; 
    1112         
     
    176177                        if (evt.bufferPercent >= 0)             returnObj.bufferPercent = evt.bufferPercent; 
    177178                        if (evt.duration >= 0)                          returnObj.duration = evt.duration; 
    178                         if (evt.message != undefined)           returnObj.message = evt.message; 
     179                        if (evt.message != "")                          returnObj.message = evt.message; 
    179180                        if (evt.metadata != null)                       returnObj.metadata = evt.metadata; 
    180181                        if (evt.offset >= 0)                            returnObj.offset = evt.offset; 
     
    218219 
    219220                protected function js_getHeight():Number { 
    220                         return _player.config.height; 
     221                        return RootReference.stage.stageHeight; 
    221222                } 
    222223                 
     
    246247 
    247248                protected function js_getWidth():Number { 
    248                         return _player.config.width; 
     249                        return RootReference.stage.stageWidth; 
    249250                } 
    250251 
  • trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerVersion.as

    r1214 r1223  
    33         
    44        public class PlayerVersion { 
    5                 protected static var _version:String = "5.3.1214"; 
     5                protected static var _version:String = "5.3.1223"; 
    66                 
    77                public static function get version():String { 
Note: See TracChangeset for help on using the changeset viewer.