Changeset 954
- Timestamp:
- 04/26/10 14:00:38 (3 years ago)
- Location:
- trunk/fl5
- Files:
-
- 8 edited
-
player.swf (modified) (previous)
-
src/com/longtailvideo/jwplayer/media/HTTPMediaProvider.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/media/SoundMediaProvider.as (modified) (2 diffs)
-
src/com/longtailvideo/jwplayer/media/VideoMediaProvider.as (modified) (3 diffs)
-
src/com/longtailvideo/jwplayer/player/PlayerV4Emulation.as (modified) (2 diffs)
-
src/com/longtailvideo/jwplayer/player/PlayerVersion.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/view/Logo.as (modified) (1 diff)
-
src/com/longtailvideo/jwplayer/view/PlayerLayoutManager.as (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fl5/src/com/longtailvideo/jwplayer/media/HTTPMediaProvider.as
r910 r954 254 254 var bufferPercent:Number; 255 255 var bufferFill:Number; 256 if (item.duration > 0 ) {256 if (item.duration > 0 && _stream && _stream.bytesTotal > 0) { 257 257 percentoffset = Math.round(_timeoffset / item.duration * 100); 258 258 bufferPercent = (_stream.bytesLoaded / _stream.bytesTotal) * (1 - _timeoffset / item.duration) * 100; -
trunk/fl5/src/com/longtailvideo/jwplayer/media/SoundMediaProvider.as
r835 r954 135 135 var bufferPercent:Number; 136 136 137 if (_sound.bytes Loaded / _sound.bytesTotal > 0.1 && (_item.duration <= 0 || _userDuration < 0)) {137 if (_sound.bytesTotal > 0 && _sound.bytesLoaded / _sound.bytesTotal > 0.1 && (_item.duration <= 0 || _userDuration < 0)) { 138 138 _item.duration = _sound.length / 1000 / _sound.bytesLoaded * _sound.bytesTotal; 139 139 } 140 140 141 if (_channel ) {141 if (_channel && _sound && _sound.bytesTotal > 0) { 142 142 _position = Math.round(_channel.position / 100) / 10; 143 143 bufferPercent = Math.floor(_sound.bytesLoaded / _sound.bytesTotal * 100); 144 } else if (!_channel && progressEvent ) {144 } else if (!_channel && progressEvent && progressEvent.bytesTotal > 0) { 145 145 bufferPercent = Math.floor(progressEvent.bytesLoaded / progressEvent.bytesTotal * 100); 146 } else { 147 bufferPercent = 0; 146 148 } 147 149 … … 183 185 /** Seek in the _sound. **/ 184 186 override public function seek(pos:Number):void { 185 if (_sound && (pos < (_sound.bytesLoaded / _sound.bytesTotal) * item.duration) || item.start) {187 if (_sound && _sound.bytesTotal > 0 && (pos < (_sound.bytesLoaded / _sound.bytesTotal) * item.duration) || item.start) { 186 188 clearInterval(_positionInterval); 187 189 _positionInterval = undefined; -
trunk/fl5/src/com/longtailvideo/jwplayer/media/VideoMediaProvider.as
r843 r954 150 150 151 151 var _streamTime:Number = Math.min(_stream.time, item.duration); 152 var bufferPercent:Number = _stream.bytes Loaded / _stream.bytesTotal * 100;152 var bufferPercent:Number = _stream.bytesTotal > 0 ? _stream.bytesLoaded / _stream.bytesTotal * 100 : 0; 153 153 var bufferTime:Number = _stream.bufferTime < (item.duration - _streamTime) ? _stream.bufferTime : Math.floor(Math.abs(item.duration - _streamTime)); 154 154 var bufferFill:Number = bufferTime == 0 ? 100 : Math.floor(_stream.bufferLength / bufferTime * 100); … … 193 193 config.bandwidth = bandwidth; 194 194 var obj:Object = {bandwidth:bandwidth}; 195 if (item.duration > 0 ) {195 if (item.duration > 0 && _stream.bytesTotal > 0) { 196 196 obj.bitrate = Math.ceil(_stream.bytesTotal / 1024 * 8 / item.duration); 197 197 } … … 215 215 216 216 private function seekStream(pos:Number, ply:Boolean=true):void { 217 var bufferLength:Number = _stream.bytes Loaded / _stream.bytesTotal * item.duration;217 var bufferLength:Number = _stream.bytesTotal > 0 ? (_stream.bytesLoaded / _stream.bytesTotal * item.duration) : 0; 218 218 if (pos <= bufferLength) { 219 219 super.seek(pos); -
trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerV4Emulation.as
r842 r954 110 110 111 111 private function errorHandler(evt:PlayerEvent):void { 112 modelEventDispatcher.dispatchEvent(new ModelEvent(ModelEvent.ERROR, {message:evt.message, id:id, client:client, version:version})); 112 113 controllerEventDispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.ERROR, {message:evt.message, id:id, client:client, version:version})); 113 114 } … … 121 122 private function mediaError(evt:MediaEvent):void { 122 123 modelEventDispatcher.dispatchEvent(new ModelEvent(ModelEvent.ERROR, {message:evt.message, id:id, client:client, version:version})); 124 controllerEventDispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.ERROR, {message:evt.message, id:id, client:client, version:version})); 123 125 } 124 126 -
trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerVersion.as
r941 r954 3 3 4 4 public class PlayerVersion { 5 protected static var _version:String = "5.2.9 41";5 protected static var _version:String = "5.2.954"; 6 6 7 7 public static function get version():String { -
trunk/fl5/src/com/longtailvideo/jwplayer/view/Logo.as
r850 r954 97 97 protected function loaderHandler(evt:Event):void { 98 98 if (getConfigParam('hide').toString() == "true") visible = false; 99 addChild(loader); 100 resize(_width, _height); 101 outHandler(); 99 if (loader is DisplayObject) { 100 addChild(loader); 101 resize(_width, _height); 102 outHandler(); 103 } else { 104 Logger.log("Logo was not a display object"); 105 } 102 106 } 103 107 -
trunk/fl5/src/com/longtailvideo/jwplayer/view/PlayerLayoutManager.as
r548 r954 28 28 toLayout = []; 29 29 noLayout = []; 30 30 31 remainingSpace = new Rectangle(0, 0, width, height); 32 31 33 for each (var plugin:String in _player.config.pluginIds) { 32 34 addLayout(plugin); … … 38 40 addLayout('dock'); 39 41 40 remainingSpace = new Rectangle(0, 0, width, height);41 42 generateLayout(); 42 43 } … … 44 45 45 46 private function addLayout(plugin:String):void { 46 var cfg:PluginConfig = _player.config.pluginConfig(plugin); 47 if (!_player.fullscreen && testPosition(cfg['position']) && Number(cfg['size']) > 0 ) { 47 var cfg:PluginConfig = _player.config.pluginConfig(plugin); 48 49 if (!_player.fullscreen && testPosition(cfg['position']) && cfg['size']) { 48 50 toLayout.push(cfg); 49 51 } else { 50 52 noLayout.push(cfg); 51 53 } 54 } 55 56 private function fitsLayout(config:PluginConfig):Boolean { 57 switch (testPosition(config['position'])) { 58 case BOTTOM: 59 case TOP: 60 var controlbarConfig:PluginConfig = _player.config.pluginConfig('controlbar'); 61 if (config['id'] != "controlbar" && (testPosition(controlbarConfig['position']) == TOP || testPosition(controlbarConfig['position']) == BOTTOM)) { 62 return ((remainingSpace.height - controlbarConfig['size']) > Number(config['size']) > 0); 63 } else { 64 return (remainingSpace.height > Number(config['size']) > 0); 65 } 66 break; 67 case LEFT: 68 case RIGHT: 69 var playlistConfig:PluginConfig = _player.config.pluginConfig('playlist'); 70 if (config['id'] != "playlist" && (testPosition(playlistConfig['position']) == LEFT || testPosition(playlistConfig['position']) == RIGHT)) { 71 return ((remainingSpace.width - playlistConfig['size']) > Number(config['size']) > 0); 72 } else { 73 return (remainingSpace.width > Number(config['size']) > 0); 74 } 75 break; 76 } 77 78 return false; 79 52 80 } 53 81 … … 81 109 var config:PluginConfig = toLayout.shift() as PluginConfig; 82 110 var pluginSpace:Rectangle = new Rectangle(); 83 var position:String = testPosition(config['position']);84 111 var size:Number = config['size']; 85 112 86 switch (position) { 87 case LEFT: 88 pluginSpace.x = remainingSpace.x; 89 pluginSpace.y = remainingSpace.y; 90 pluginSpace.width = size; 91 pluginSpace.height = remainingSpace.height; 92 remainingSpace.width -= size; 93 remainingSpace.x += size; 94 break; 95 case RIGHT: 96 pluginSpace.x = remainingSpace.x + remainingSpace.width - size; 97 pluginSpace.y = remainingSpace.y; 98 pluginSpace.width = size; 99 pluginSpace.height = remainingSpace.height; 100 remainingSpace.width -= size; 101 break; 102 case TOP: 103 pluginSpace.x = remainingSpace.x; 104 pluginSpace.y = remainingSpace.y; 105 pluginSpace.width = remainingSpace.width; 106 pluginSpace.height = size; 107 remainingSpace.height -= size; 108 remainingSpace.y += size; 109 break; 110 case BOTTOM: 111 pluginSpace.x = remainingSpace.x; 112 pluginSpace.y = remainingSpace.y + remainingSpace.height - size; 113 pluginSpace.width = remainingSpace.width; 114 pluginSpace.height = size; 115 remainingSpace.height -= size; 116 break; 113 if (fitsLayout(config)) { 114 switch (testPosition(config['position'])) { 115 case LEFT: 116 pluginSpace.x = remainingSpace.x; 117 pluginSpace.y = remainingSpace.y; 118 pluginSpace.width = size; 119 pluginSpace.height = remainingSpace.height; 120 remainingSpace.width -= size; 121 remainingSpace.x += size; 122 break; 123 case RIGHT: 124 pluginSpace.x = remainingSpace.x + remainingSpace.width - size; 125 pluginSpace.y = remainingSpace.y; 126 pluginSpace.width = size; 127 pluginSpace.height = remainingSpace.height; 128 remainingSpace.width -= size; 129 break; 130 case TOP: 131 pluginSpace.x = remainingSpace.x; 132 pluginSpace.y = remainingSpace.y; 133 pluginSpace.width = remainingSpace.width; 134 pluginSpace.height = size; 135 remainingSpace.height -= size; 136 remainingSpace.y += size; 137 break; 138 case BOTTOM: 139 pluginSpace.x = remainingSpace.x; 140 pluginSpace.y = remainingSpace.y + remainingSpace.height - size; 141 pluginSpace.width = remainingSpace.width; 142 pluginSpace.height = size; 143 remainingSpace.height -= size; 144 break; 145 } 146 147 config['visible'] = true; 148 assignSpace(config, pluginSpace); 149 } else { 150 noLayout.push(config); 117 151 } 118 119 config['visible'] = true;120 assignSpace(config, pluginSpace);121 152 122 153 generateLayout();
Note: See TracChangeset
for help on using the changeset viewer.
