Changeset 104


Ignore:
Timestamp:
11/06/08 13:25:45 (5 years ago)
Author:
jeroen
Message:

added HD switch plugin (and fixed a bug in the LOAD event

Location:
trunk/as3
Files:
3 added
8 edited

Legend:

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

    r103 r104  
    256256                h264 = false; 
    257257                keyframes = undefined; 
     258                metadata = false; 
    258259                if(stream.bytesLoaded != stream.bytesTotal) { 
    259260                        stream.close(); 
  • trunk/as3/com/jeroenwijering/models/VideoModel.as

    r103 r104  
    163163        /** Destroy the video. **/ 
    164164        public function stop():void { 
     165                stream.pause(); 
    165166                if(stream.bytesLoaded != stream.bytesTotal) { 
    166167                        stream.close(); 
    167168                } 
    168                 stream.pause(); 
    169169                metadata = false; 
    170170                clearInterval(loadinterval); 
  • trunk/as3/com/jeroenwijering/player/Controller.as

    r103 r104  
    177177                        var arr:Array = new Array(); 
    178178                        for each(var itm:Object in obj) { 
    179                                 arr.push(ObjectParser.parse(obj)); 
     179                                arr.push(ObjectParser.parse(itm)); 
    180180                        } 
    181181                        playlistHandler(arr); 
     
    297297                        playlist = ply; 
    298298                } else { 
    299                         dispatchEvent(new ControllerEvent(ControllerEvent.ERROR,'No valid filetypes found in this playlist')); 
     299                        dispatchEvent(new ControllerEvent(ControllerEvent.ERROR,{message:'No valid filetypes found in this playlist'})); 
    300300                        return; 
    301301                } 
  • trunk/as3/com/jeroenwijering/player/Model.as

    r103 r104  
    2828        /** The list with all active models. **/ 
    2929        private var models:Object; 
    30         /** Currently active model. **/ 
    31         private var currentModel:String; 
    32         /** Currently active mediafile. **/ 
    33         private var currentURL:String; 
    3430        /** Loader for the preview image. **/ 
    3531        private var thumb:Loader; 
    3632        /** Save the current image to prevent overloading. **/ 
    3733        private var image:String; 
     34        /** Currently active model. **/ 
     35        private var currentModel:String; 
    3836 
    3937 
     
    6361        private function itemHandler(evt:ControllerEvent):void { 
    6462                var typ:String = playlist[config['item']]['type']; 
    65                 var url:String = playlist[config['item']]['file']; 
    66                 if(typ == currentModel) { 
    67                         if(url == currentURL) { 
    68                                 models[typ].seek(playlist[config['item']]['start']); 
    69                         } else { 
    70                                 models[typ].stop(); 
    71                                 currentURL = url; 
    72                                 models[typ].load(); 
    73                         } 
     63                if(currentModel) { 
     64                        models[currentModel].stop(); 
     65                } 
     66                if(!models[typ]) { 
     67                        loadModel(typ); 
     68                } 
     69                if(models[typ]) { 
     70                        currentModel = typ; 
     71                        models[typ].load(); 
    7472                } else { 
    75                         if(currentModel) { 
    76                                 models[currentModel].stop(); 
    77                         } 
    78                         if(!models[typ]) { 
    79                                 loadModel(typ); 
    80                         } 
    81                         if(models[typ]) {  
    82                                 currentModel = typ; 
    83                                 currentURL = url; 
    84                                 models[typ].load(); 
    85                         } else { 
    86                                 sendEvent(ModelEvent.ERROR,{message:''}); 
    87                                  
    88                         } 
     73                        sendEvent(ModelEvent.ERROR,{message:'No suiteable model found for playback.'}); 
    8974                } 
    9075                thumbLoader(); 
     
    185170        /** Load the configuration array. **/ 
    186171        private function stopHandler(evt:ControllerEvent=undefined):void { 
    187                 currentURL = undefined; 
    188172                if(currentModel) { 
    189173                        models[currentModel].stop(); 
     
    205189                                                thumb.visible = true; 
    206190                                                skin.display.media.visible = false; 
    207                                                 sendEvent(ModelEvent.TIME,{ 
    208                                                         position:playlist[config['item']]['start'], 
    209                                                         duration:playlist[config['item']]['duration'] 
    210                                                 }); 
     191                                                sendEvent(ModelEvent.TIME,{position:0,duration:playlist[config['item']]['duration']}); 
    211192                                                break; 
    212193                                        case ModelStates.PLAYING: 
  • trunk/as3/com/jeroenwijering/player/Player.as

    r103 r104  
    6767                token:undefined, 
    6868                tracecall:undefined, 
    69                 version:'4.3.101' 
     69                version:'4.3.103' 
    7070        }; 
    7171        /** Reference to all stage graphics. **/ 
  • trunk/as3/com/jeroenwijering/player/SPLoader.as

    r103 r104  
    8181                if(skn) { 
    8282                        ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,skinError); 
    83                         ldr.contentLoaderInfo.addEventListener(Event.INIT,skinHandler); 
     83                        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,skinHandler); 
    8484                } else { 
    8585                        player.skin.addChild(ldr); 
    8686                        ldr.visible = false; 
    8787                        ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,pluginError); 
    88                         ldr.contentLoaderInfo.addEventListener(Event.INIT,pluginHandler); 
     88                        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,pluginHandler); 
    8989                } 
    9090                if(player.loaderInfo.url.indexOf('http') == 0) { 
     
    116116        /** Plugin loading completed; add to stage and populate. **/ 
    117117        private function pluginHandler(evt:Event):void { 
    118                 try {  
     118                try { 
    119119                        evt.target.content.initializePlugin(player.view); 
    120120                        evt.target.loader.visible = true; 
Note: See TracChangeset for help on using the changeset viewer.