Changeset 355


Ignore:
Timestamp:
09/13/09 13:32:52 (4 years ago)
Author:
jeroen
Message:

increased the resolution of smoothmodel position interval

Location:
trunk/as3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/as3/com/jeroenwijering/models/SmoothModel.as

    r354 r355  
    146146        override public function play():void { 
    147147                chunks[chunk].netstream.resume(); 
    148                 interval = setInterval(positionInterval,50); 
     148                interval = setInterval(positionInterval,40); 
    149149                model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.PLAYING}); 
    150150        }; 
     
    155155                var chk:Number = chunk; 
    156156                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; 
    158158                if(model.config['state'] != ModelStates.PLAYING) { 
    159159                        model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.PLAYING}); 
    160160                } 
    161                 if(position > obj['end']-0.2) { 
     161                if(pos > obj['end']-0.15) { 
    162162                        setTimeout(killChunk,2000,chk); 
    163163                        playChunk(chk+1); 
    164164                        setTimeout(loadChunk,1000,chk+2); 
    165165                } 
    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                        } 
    168172                } else if (item['duration'] > 0) { 
    169173                        obj.netstream.pause(); 
     
    188192                        } 
    189193                } 
    190                 interval = setInterval(positionInterval,50); 
     194                interval = setInterval(positionInterval,40); 
    191195                model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.BUFFERING}); 
    192196        }; 
Note: See TracChangeset for help on using the changeset viewer.