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

Commit

Permalink
[video_player_web] fix: set autoplay to false during initialization (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Jun 1, 2021
1 parent 004485c commit 93d6791
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/video_player/video_player_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 2.0.1

* Fix videos not playing in Safari/Chrome on iOS by setting autoplay to false
* Change sizing code of `Video` widget's `HtmlElementView` so it works well when slotted.
* Move tests to `example` directory, so they run as integration_tests with `flutter drive`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ class _VideoPlayer {
// Allows Safari iOS to play the video inline
videoElement.setAttribute('playsinline', 'true');

// Set autoplay to false since most browsers won't autoplay a video unless it is muted
videoElement.setAttribute('autoplay', 'false');

// TODO(hterkelsen): Use initialization parameters once they are available
ui.platformViewRegistry.registerViewFactory(
'videoPlayer-$textureId', (int viewId) => videoElement);
Expand Down

0 comments on commit 93d6791

Please sign in to comment.