Changeset 104
- Timestamp:
- 11/06/08 13:25:45 (5 years ago)
- Location:
- trunk/as3
- Files:
-
- 3 added
- 8 edited
-
com/jeroenwijering/models/HTTPModel.as (modified) (1 diff)
-
com/jeroenwijering/models/VideoModel.as (modified) (1 diff)
-
com/jeroenwijering/player/Controller.as (modified) (2 diffs)
-
com/jeroenwijering/player/Model.as (modified) (4 diffs)
-
com/jeroenwijering/player/Player.as (modified) (1 diff)
-
com/jeroenwijering/player/SPLoader.as (modified) (2 diffs)
-
com/jeroenwijering/plugins/HD.as (added)
-
hd.fla (added)
-
hd.swf (added)
-
player.fla (modified) (previous)
-
player.swf (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
trunk/as3/com/jeroenwijering/models/HTTPModel.as
r103 r104 256 256 h264 = false; 257 257 keyframes = undefined; 258 metadata = false; 258 259 if(stream.bytesLoaded != stream.bytesTotal) { 259 260 stream.close(); -
trunk/as3/com/jeroenwijering/models/VideoModel.as
r103 r104 163 163 /** Destroy the video. **/ 164 164 public function stop():void { 165 stream.pause(); 165 166 if(stream.bytesLoaded != stream.bytesTotal) { 166 167 stream.close(); 167 168 } 168 stream.pause();169 169 metadata = false; 170 170 clearInterval(loadinterval); -
trunk/as3/com/jeroenwijering/player/Controller.as
r103 r104 177 177 var arr:Array = new Array(); 178 178 for each(var itm:Object in obj) { 179 arr.push(ObjectParser.parse( obj));179 arr.push(ObjectParser.parse(itm)); 180 180 } 181 181 playlistHandler(arr); … … 297 297 playlist = ply; 298 298 } 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'})); 300 300 return; 301 301 } -
trunk/as3/com/jeroenwijering/player/Model.as
r103 r104 28 28 /** The list with all active models. **/ 29 29 private var models:Object; 30 /** Currently active model. **/31 private var currentModel:String;32 /** Currently active mediafile. **/33 private var currentURL:String;34 30 /** Loader for the preview image. **/ 35 31 private var thumb:Loader; 36 32 /** Save the current image to prevent overloading. **/ 37 33 private var image:String; 34 /** Currently active model. **/ 35 private var currentModel:String; 38 36 39 37 … … 63 61 private function itemHandler(evt:ControllerEvent):void { 64 62 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(); 74 72 } 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.'}); 89 74 } 90 75 thumbLoader(); … … 185 170 /** Load the configuration array. **/ 186 171 private function stopHandler(evt:ControllerEvent=undefined):void { 187 currentURL = undefined;188 172 if(currentModel) { 189 173 models[currentModel].stop(); … … 205 189 thumb.visible = true; 206 190 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']}); 211 192 break; 212 193 case ModelStates.PLAYING: -
trunk/as3/com/jeroenwijering/player/Player.as
r103 r104 67 67 token:undefined, 68 68 tracecall:undefined, 69 version:'4.3.10 1'69 version:'4.3.103' 70 70 }; 71 71 /** Reference to all stage graphics. **/ -
trunk/as3/com/jeroenwijering/player/SPLoader.as
r103 r104 81 81 if(skn) { 82 82 ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,skinError); 83 ldr.contentLoaderInfo.addEventListener(Event. INIT,skinHandler);83 ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,skinHandler); 84 84 } else { 85 85 player.skin.addChild(ldr); 86 86 ldr.visible = false; 87 87 ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,pluginError); 88 ldr.contentLoaderInfo.addEventListener(Event. INIT,pluginHandler);88 ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,pluginHandler); 89 89 } 90 90 if(player.loaderInfo.url.indexOf('http') == 0) { … … 116 116 /** Plugin loading completed; add to stage and populate. **/ 117 117 private function pluginHandler(evt:Event):void { 118 try { 118 try { 119 119 evt.target.content.initializePlugin(player.view); 120 120 evt.target.loader.visible = true;
Note: See TracChangeset
for help on using the changeset viewer.
