-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[video_player] Add web implementation using platform interface #2279
Conversation
cc @hterkelsen |
49b93ae
to
d110f95
Compare
3816e66
to
5de4950
Compare
5de4950
to
92f8570
Compare
@hterkelsen this should be ready for review as well. Thanks for all your help! |
92f8570
to
f376060
Compare
7e21aec
to
355b90e
Compare
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? |
@hterkelsen PTAL (Not sure if you have already seen this PR and are subscribed. If you are, please excuse the noise.) |
packages/video_player/video_player_web/lib/video_player_web.dart
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_web/lib/video_player_web.dart
Outdated
Show resolved
Hide resolved
d7c8e70
to
29b98a8
Compare
packages/video_player/video_player_web/lib/video_player_web.dart
Outdated
Show resolved
Hide resolved
29b98a8
to
6a7e313
Compare
@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? |
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 |
There was a problem hiding this 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.
packages/video_player/video_player_web/lib/video_player_web.dart
Outdated
Show resolved
Hide resolved
Please do not merge yet. I just found a bug I'd like to fix first. |
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. |
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! |
…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
…er#2279) * Add web implementation * Address review comments * Rename setupVideoPlayer() to initialize() * Send correct VideoEventType * Add autoplay note to README.
…er#2279) * Add web implementation * Address review comments * Rename setupVideoPlayer() to initialize() * Send correct VideoEventType * Add autoplay note to README.
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.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?