srt_parser 1.0.1+1 copy "srt_parser: ^1.0.1+1" to clipboard
srt_parser: ^1.0.1+1 copied to clipboard

outdated

A cross-platform, simple .srt file parser that allows you to read a String and convert it to a list of subtitle object.

.srt parser #

description #

A simple .srt file parser that allows you to read a String and convert it to a list of subtitle object.
Each Subtitle object contains a begin and an end time stamp and a list of subtitle strings.

Example #

import 'package:srt_parser/srt_parser.dart';

const String data = '''1
00:02:26,407 --> 00:02:31,356  X1:100 X2:100 Y1:100 Y2:100
-- Arman I trust you
-- Arrrrrghhhhhh, ja ja 

2
00:02:31,567 --> 00:02:37,164 
-- Lukas is publishing his library.
-- I like the man.
''';

void main() {
  List<Subtitle> subtitles = parseSrt(data);
  for (Subtitle item in subtitles) {
    print('ID is: ${item.id}');
    print('Begin is: ${item.range.begin} and End is: ${item.range.end}');
    for (String line in item.lines) {
      print(line);
    }
    print('----');
  }
}

8
likes
0
pub points
44%
popularity

Publisher

unverified uploader

A cross-platform, simple .srt file parser that allows you to read a String and convert it to a list of subtitle object.

Repository
View/report issues

License

unknown (LICENSE)

More

Packages that depend on srt_parser