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

[video_player] Add web implementation using platform interface #2279

Merged
merged 5 commits into from
Dec 4, 2019

Conversation

cbenhagen
Copy link
Contributor

@cbenhagen cbenhagen commented Nov 14, 2019

Description

Adding video_player_web implementation using the platform interface from #2273

Fixes flutter/flutter#45290

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.

@cbenhagen
Copy link
Contributor Author

cc @hterkelsen

@cbenhagen cbenhagen changed the title [video_player] [WIP] Add web implementation using platform interface [video_player] Add web implementation using platform interface Nov 22, 2019
@cbenhagen
Copy link
Contributor Author

cbenhagen commented Nov 22, 2019

@hterkelsen this should be ready for review as well. Thanks for all your help!

@cbenhagen
Copy link
Contributor Author

Added some basic tests and made the VideoPlayer class private.

On the web we can't just autoplay videos with sound (See https://goo.gl/xX8pDD). How should the plugin handle this? In the tests I am muting the video before playing. Is it ok to have this throw a runtime exception? How can we best help users to avoid that?

@cbenhagen
Copy link
Contributor Author

@hterkelsen PTAL

(Not sure if you have already seen this PR and are subscribed. If you are, please excuse the noise.)

@harryterkelsen harryterkelsen self-requested a review November 28, 2019 21:01
@cbenhagen
Copy link
Contributor Author

@hterkelsen what are your thoughts on the autoplay issue? Is this something the plugin should try to handle? If yes, do we need to improve it now or can we do that at a later stage?

@harryterkelsen
Copy link
Contributor

We should document the autoplay issue issue with a link to the Chrome Autoplay Policy changes article. I don't think we should block landing this plugin on it, though. As long as the VideoPlayerController can play and pause videos with sound on user taps, then we should be good.

Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

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

I am not extremely familiar with the video player API but this looks fine to me. @hterkelsen do you want to merge this one?

Thank you for the contribution.

@cbenhagen
Copy link
Contributor Author

Please do not merge yet. I just found a bug I'd like to fix first.

@cbenhagen
Copy link
Contributor Author

Done. Sorry for the noise and the missed bug. This should be ready to merge now. @hterkelsen I also added a note about the potential autoplay issues to the readme.

@harryterkelsen
Copy link
Contributor

I'll land this as soon as the tests go green. @cbenhagen Thanks so much for this contribution, and for being so patient with all the reviews! This is a huge improvement for all Flutter for web users!

@harryterkelsen harryterkelsen merged commit 61eb683 into flutter:master Dec 4, 2019
daohoangson added a commit to daohoangson/plugins that referenced this pull request Dec 7, 2019
…flutter/has_gesture

* commit 'be71485431cd5ebaeb7cad4c57ddeb0be910d8b6': (74 commits)
  [webview_flutter] Add support for onPageStarted event (flutter#2295)
  adds missing [[ to elif statement in scripts/incremental_build.sh (flutter#2358)
  [none] Pass --custom-analysis flag through CI (flutter#2356)
  [video_player] Document public API of video_player_platform_interface. (flutter#2355)
  [none] Lock pedantic version (flutter#2354)
  [video_player_platform_interface] Fix some pedantic lints (flutter#2349)
  Export SignInOption from interface since it is used in the frontend (flutter#2350)
  Update documentation for connectivity (flutter#2328)
  [ android_alarm_manager ] Loosen Flutter SDK lower bound, update README (flutter#2338)
  [e2e_macos] Remove redundant analysis_options.yaml (flutter#2347)
  Revert "[android_alarm_manager] Update minimum Flutter version to 1.12.0 (flutter#2327)" (flutter#2345)
  [video_player] Add web implementation using platform interface (flutter#2279)
  [webview_flutter] Fix pedantic lint errors (flutter#2322)
  [google_maps_flutter] Add documentation (flutter#2303)
  [e2e] Fix pedantic lints (flutter#2315)
  [video_player] Fix pedantic lints (flutter#2321)
  [share] Fix pedantic lints (flutter#2320)
  [battery] Fix pedantic linter errors (flutter#2311)
  [device_info] Fix pedantic errors (flutter#2314)
  [in_app_purchase] Fix most failing pedantic lints (flutter#2317)
  ...

# Conflicts:
#	packages/webview_flutter/CHANGELOG.md
#	packages/webview_flutter/lib/platform_interface.dart
#	packages/webview_flutter/lib/webview_flutter.dart
#	packages/webview_flutter/pubspec.yaml
sungmin-park pushed a commit to sungmin-park/flutter-plugins that referenced this pull request Dec 17, 2019
…er#2279)

* Add web implementation

* Address review comments

* Rename setupVideoPlayer() to initialize()

* Send correct VideoEventType

* Add autoplay note to README.
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
…er#2279)

* Add web implementation

* Address review comments

* Rename setupVideoPlayer() to initialize()

* Send correct VideoEventType

* Add autoplay note to README.
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.

[video_player] Support video_player on web.
4 participants