Changeset 355
- Timestamp:
- 09/13/09 13:32:52 (4 years ago)
- Location:
- trunk/as3
- Files:
-
- 2 edited
-
com/jeroenwijering/models/SmoothModel.as (modified) (3 diffs)
-
player.swf (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
trunk/as3/com/jeroenwijering/models/SmoothModel.as
r354 r355 146 146 override public function play():void { 147 147 chunks[chunk].netstream.resume(); 148 interval = setInterval(positionInterval, 50);148 interval = setInterval(positionInterval,40); 149 149 model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.PLAYING}); 150 150 }; … … 155 155 var chk:Number = chunk; 156 156 var obj:Object = chunks[chunk]; 157 position = Math.round((obj['start']+obj.netstream.time)*10)/10;157 var pos:Number = obj['start']+obj.netstream.time; 158 158 if(model.config['state'] != ModelStates.PLAYING) { 159 159 model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.PLAYING}); 160 160 } 161 if(pos ition > obj['end']-0.2) {161 if(pos > obj['end']-0.15) { 162 162 setTimeout(killChunk,2000,chk); 163 163 playChunk(chk+1); 164 164 setTimeout(loadChunk,1000,chk+2); 165 165 } 166 if(position < item['duration']) { 167 model.sendEvent(ModelEvent.TIME,{position:position,duration:item['duration'],chunk:chk}); 166 if(pos < item['duration']) { 167 pos = Math.round(pos*10)/10; 168 if(pos != position) { 169 position = pos; 170 model.sendEvent(ModelEvent.TIME,{position:pos,duration:item['duration'],chunk:chk}); 171 } 168 172 } else if (item['duration'] > 0) { 169 173 obj.netstream.pause(); … … 188 192 } 189 193 } 190 interval = setInterval(positionInterval, 50);194 interval = setInterval(positionInterval,40); 191 195 model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.BUFFERING}); 192 196 };
Note: See TracChangeset
for help on using the changeset viewer.
