| Package | vegas.media.subtitles |
| Class | public class SRTParser |
| Inheritance | SRTParser GenericParser Object |
Example :
import vegas.media.subtitles.SRTParser ;
var source:String = "1\r" ;
srt += "00:00:20,000 --> 00:00:24,400\r" ;
srt += "You can use a SRTParser instance\r" ;
srt += "to eval your external subtitles files.\r" ;
srt += "\n" ;
srt += "2\r" ;
srt += "00:00:24,600 --> 00:00:27,800\r" ;
srt += "You must use the Array of Caption objects.\r" ;
srt += "\n" ;
srt += "3\r" ;
srt += "00:00:30,600 --> 00:00:35,200\r" ;
srt += "You can creates your custom subtitle engine now." ;
var parser:SRTParser = new SRTParser(srt) ;
var captions:Array = parser.eval() ;
trace( " captions:" + captions ) ;
| Method | Defined By | ||
|---|---|---|---|
SRTParser(source:String = null)
Creates a new SRTParser instance. | SRTParser | ||
Evaluates the String source and return a list of SRT captions. | SRTParser | ||
![]() | getChar():String
Returns the current char in the parse process. | GenericParser | |
![]() | getCharAt(pos:uint):String
Returns the char in the source to parse at the specified position. | GenericParser | |
![]() | hasMoreChar():Boolean
Indicates if the source parser has more char. | GenericParser | |
![]() | next():String
Returns the next character in the source of this parser. | GenericParser | |
| SRTParser | () | Constructor |
public function SRTParser(source:String = null)Creates a new SRTParser instance.
Parameterssource:String (default = null) — The string expression to parse.
|
| eval | () | method |
public function eval():Vector.<Caption>Evaluates the String source and return a list of SRT captions.
ReturnsVector.<Caption> |