Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Value not in range: 11? #9

Open
fadone opened this issue Aug 31, 2023 · 3 comments
Open

RangeError: Value not in range: 11? #9

fadone opened this issue Aug 31, 2023 · 3 comments

Comments

@fadone
Copy link

fadone commented Aug 31, 2023

I am getting this error when using asset subtitle,
Unhandled Exception: RangeError: Value not in range: 11
E/flutter (31902): #0 _RegExpMatch.group (dart:core-patch/regexp_patch.dart:95:7)
E/flutter (31902): #1 SubtitleParser._decodeSubtitleFormat subtitle_parser.dart:87
E/flutter (31902): #2 SubtitleParser.parsing subtitle_parser.dart:61
E/flutter (31902): #3 ISubtitleController.initial subtitle_controller.dart:5

Here is my code,
SubtitleController? _subtitleController;
_subtitleController = SubtitleController( provider: const AssetSubtitle('assets/videos/video.srt'), );
await _subtitleController!.initial();

And here is the subtitle line where the error is occuring,
1
00:00:00,009 --> 00:00:03,258
Let me give you the best analogy you've ever heard about the human body.

@thinhnd-nal
Copy link

I was forced back to beta.3 using subtitle: 0.1.0-beta.3 (without the ^).
Or you can also use this lib instead https://pub.dev/packages/subtitle_wrapper_package

@boqxfjge
Copy link

boqxfjge commented Nov 17, 2023

Same error!
I tried subtitle: 0.1.0-beta.3,but the result of print(controller.subtitles) became empty list: []
Here is my srt subtitle (it has double text lines):

14
00:00:45,520 --> 00:00:46,520
A:いいですか?
A:这样可以吗?

15
00:00:47,600 --> 00:00:49,160
B:はい、いいです。
B:嗯,可以的。

@Yang321423
Copy link

Yang321423 commented Jun 15, 2024

This package seems to have a serious flaw. It only handles English subtitles.
For non-English subtitles, controller.subtitles becomes an empty list ([ ]).
I guess he made a mistake using RegExp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants