Changeset 880


Ignore:
Timestamp:
03/10/10 05:35:44 (3 years ago)
Author:
jeroen
Message:

Fixed #767 captions issues and checked in initial version of v5 captions

Location:
plugins
Files:
48 added
2 edited
12 moved

Legend:

Unmodified
Added
Removed
  • plugins/captions/v4/com/jeroenwijering/parsers/TTParser.as

    r317 r880  
    4545        /** Parse a single captions entry. **/ 
    4646        private static function parseCaption(dat:XML):Object { 
    47                 var ptn:RegExp = /(\n<br.*>\n)+/; 
    4847                var obj:Object = { 
    4948                        begin:Strings.seconds(dat.@begin), 
    5049                        dur:Strings.seconds(dat.@dur), 
    5150                        end:Strings.seconds(dat.@end), 
    52                         text:dat.children().toString().replace(ptn,'\n').replace(ptn,'\n') 
     51                        text:dat.children().toString().replace(new RegExp("\r?\n","g"),' ') 
    5352                }; 
    5453                return obj; 
  • plugins/captions/v4/com/jeroenwijering/plugins/Captions.as

    r486 r880  
    6969                back.graphics.drawRect(0,0,400,20); 
    7070                addChild(back); 
     71                back.mouseEnabled = false; 
    7172                format = new TextFormat(); 
    7273                format.color = 0xFFFFFF; 
     
    7778                field = new TextField(); 
    7879                field.width = 400; 
    79                 field.height = 10; 
     80                field.height = 1; 
    8081                field.y = 5; 
    8182                field.autoSize = "center"; 
     
    8485                field.wordWrap = true; 
    8586                field.defaultTextFormat = format; 
     87                field.text = ''; 
    8688                addChild(field); 
     89                field.mouseEnabled = false; 
    8790                if(config['back'] == false) { 
    8891                        back.alpha = 0; 
     
    124127                view.addModelListener(ModelEvent.META,metaHandler); 
    125128                drawClip(); 
    126                 mouseEnabled = false; 
    127                 mouseChildren = false; 
    128129                if(view.config['dock']) { 
    129130                        button = view.getPlugin('dock').addButton(new DockIcon(),'is on',clickHandler); 
     
    146147                        file = view.playlist[view.config['item']]['captions.file']; 
    147148                } else if (view.playlist[view.config['item']]['captions']){ 
    148                         file = view.playlist[view.config['item']]['captions'];  
     149                        file = view.playlist[view.config['item']]['captions']; 
    149150                } else if(view.config['captions.file']) { 
    150151                        file = view.config['captions.file']; 
     
    198199        /** Resize the captions if the display changes. **/ 
    199200        private function resizeHandler(evt:ControllerEvent=undefined):void { 
    200                 back.height = field.height + 10; 
     201                if(field.length > 3) { 
     202                        back.height = field.height + 10; 
     203                } else {  
     204                        back.height = 0; 
     205                } 
    201206                width = view.config['width']; 
    202207                scaleY = scaleX; 
    203208                y = view.config['height']-height; 
     209                if(view.config['controlbar'] == 'over' || view.config['fullscreen']) {  
     210                        y -= 50; 
     211                } 
    204212        }; 
    205213 
Note: See TracChangeset for help on using the changeset viewer.