Changeset 165
- Timestamp:
- 02/18/09 16:45:52 (4 years ago)
- File:
-
- 1 edited
-
trunk/as3/com/jeroenwijering/plugins/Captions.as (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/as3/com/jeroenwijering/plugins/Captions.as
r161 r165 152 152 private function itemHandler(evt:ControllerEvent=null):void { 153 153 current = 0; 154 captions = new Array();155 154 var fil:String = view.playlist[view.config['item']]['captions.file']; 156 155 if(fil) { … … 169 168 /** Captions are loaded; now display them. **/ 170 169 private function loaderHandler(evt:Event):void { 171 if(config['file'].substr(-3) == 'srt') { 170 var ext:String = config['file'].substr(-3); 171 captions = new Array(); 172 if(ext == 'srt' || ext == 'txt') { 172 173 captions = SRTParser.parseCaptions(String(evt.target.data)); 173 174 } else { … … 201 202 } 202 203 } 203 204 204 }; 205 205 … … 208 208 private function timeHandler(evt:ModelEvent):void { 209 209 var pos:Number = evt.data.position; 210 if(captions .length > 0&& (captions[current]['begin'] > pos || captions[current+1]['begin'] < pos)) {210 if(captions && (captions[current]['begin'] > pos || captions[current+1]['begin'] < pos)) { 211 211 setCaption(pos); 212 212 }
Note: See TracChangeset
for help on using the changeset viewer.
