Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[Closed Captioning] Create SubRip file parser and dart closed caption data object #2473

Merged
merged 21 commits into from
Jan 28, 2020

Conversation

johnsonmh
Copy link
Contributor

Description

This PR specifies a dart object that represents a "Closed Caption". This will be useful in a follow up PR, where I will add closed caption support the the VideoPlayerController.

Related Issues

flutter/flutter#25388

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

Copy link

@rami-a rami-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johnsonmh johnsonmh changed the title [Closed Captioning] Create .srt file parser and dart closed caption data object [Closed Captioning] Create 'sub rip' file parser and dart closed caption data object Jan 15, 2020
@johnsonmh johnsonmh changed the title [Closed Captioning] Create 'sub rip' file parser and dart closed caption data object [Closed Captioning] Create SubRip file parser and dart closed caption data object Jan 15, 2020
@johnsonmh johnsonmh requested review from mklim and removed request for clocksmith and willlarche January 15, 2020 22:29
Copy link
Contributor

@mklim mklim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! The approach is good, but there's a few things that I think should be changed before landing.

packages/video_player/closed_caption_file/pubspec.yaml Outdated Show resolved Hide resolved
fourthCaption.text,
'- [ Machinery Beeping ]\n- I\'m not sure what that was,',
);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Some test cases for what happens with invalid input would be great, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@mklim mklim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit test is failing in CI, but it's not obvious to me why:

00:07 +12 -1: /tmp/cirrus-ci-build/packages/video_player/video_player/test/sub_rip_file_test.dart: Parses SubRip file [E]                                                                              
  Unsupported operation: _Namespace
  package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 196:49      throw_
  package:dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 202:5                   get _namespace
  package:dart-sdk/lib/io/file_impl.dart 488:31                                             openSync
  package:dart-sdk/lib/io/file_impl.dart 549:18                                             readAsBytesSync
  package:dart-sdk/lib/io/file_impl.dart 594:18                                             readAsStringSync
  sub_rip_file_test.dart 15:31                                                              <fn>
  package:test_api                                                                          <fn>

Just double checking, it passes locally? the js_dev_runtime part looks suspicious to me, maybe this has something to do with the federated web implementation?

video_player's minor version should be bumped in pubspec.yaml and CHANGELOG.md now since it's been moved into that package.

Other than that the implementation here looks solid.

Copy link
Contributor

@mklim mklim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@mklim mklim merged commit ec39e65 into flutter:master Jan 28, 2020
WoodyGuo pushed a commit to liuwei1130/plugins that referenced this pull request Feb 10, 2020
… data object (flutter#2473)

This PR specifies a dart object that represents a "Closed Caption". This will be useful in a follow up PR, where I will add closed caption support the the `VideoPlayerController`.
WoodyGuo pushed a commit to liuwei1130/plugins that referenced this pull request Feb 10, 2020
… data object (flutter#2473)

This PR specifies a dart object that represents a "Closed Caption". This will be useful in a follow up PR, where I will add closed caption support the the `VideoPlayerController`.
EdwinRomelta pushed a commit to EdwinRomelta/plugins that referenced this pull request Jun 11, 2020
… data object (flutter#2473)

This PR specifies a dart object that represents a "Closed Caption". This will be useful in a follow up PR, where I will add closed caption support the the `VideoPlayerController`.
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
… data object (flutter#2473)

This PR specifies a dart object that represents a "Closed Caption". This will be useful in a follow up PR, where I will add closed caption support the the `VideoPlayerController`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants