diff --git a/packages/video_player/video_player_web/CHANGELOG.md b/packages/video_player/video_player_web/CHANGELOG.md index cac6a397996f..d0ef30ca738d 100644 --- a/packages/video_player/video_player_web/CHANGELOG.md +++ b/packages/video_player/video_player_web/CHANGELOG.md @@ -1,6 +1,10 @@ +## 2.3.1 + +* Fixes some `package:web` tweaks. + ## 2.3.0 -* Migrates package and tests to `package:web``. +* Migrates package and tests to `package:web`. * Fixes infinite event loop caused by `seekTo` when the video ends. ## 2.2.0 diff --git a/packages/video_player/video_player_web/example/integration_test/pkg_web_tweaks.dart b/packages/video_player/video_player_web/example/integration_test/pkg_web_tweaks.dart index ccf5b32e5c65..f59ba6cbb4a7 100644 --- a/packages/video_player/video_player_web/example/integration_test/pkg_web_tweaks.dart +++ b/packages/video_player/video_player_web/example/integration_test/pkg_web_tweaks.dart @@ -11,12 +11,16 @@ import 'package:web/web.dart' as web; /// Adds a `controlsList` and `disablePictureInPicture` getters. extension NonStandardGettersOnVideoElement on web.HTMLVideoElement { external web.DOMTokenList? get controlsList; - external JSBoolean get disablePictureInPicture; + // TODO(srujzs): This will be added in `package:web` 0.6.0. Remove this helper + // once it's available. + external bool get disablePictureInPicture; } /// Adds a `disableRemotePlayback` getter. extension NonStandardGettersOnMediaElement on web.HTMLMediaElement { - external JSBoolean get disableRemotePlayback; + // TODO(srujzs): This will be added in `package:web` 0.6.0. Remove this helper + // once it's available. + external bool get disableRemotePlayback; } /// Defines JS interop to access static methods from `Object`. diff --git a/packages/video_player/video_player_web/lib/src/pkg_web_tweaks.dart b/packages/video_player/video_player_web/lib/src/pkg_web_tweaks.dart index c0ae661c96b2..3ba2c94ea929 100644 --- a/packages/video_player/video_player_web/lib/src/pkg_web_tweaks.dart +++ b/packages/video_player/video_player_web/lib/src/pkg_web_tweaks.dart @@ -2,16 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_interop'; import 'package:web/web.dart' as web; /// Adds a "disablePictureInPicture" setter to [web.HTMLVideoElement]s. extension NonStandardSettersOnVideoElement on web.HTMLVideoElement { - external set disablePictureInPicture(JSBoolean disabled); + // TODO(srujzs): This will be added in `package:web` 0.6.0. Remove this helper + // once it's available. + external set disablePictureInPicture(bool disabled); } /// Adds a "disableRemotePlayback" and "controlsList" setters to [web.HTMLMediaElement]s. extension NonStandardSettersOnMediaElement on web.HTMLMediaElement { - external set disableRemotePlayback(JSBoolean disabled); - external set controlsList(JSString? controlsList); + // TODO(srujzs): This will be added in `package:web` 0.6.0. Remove this helper + // once it's available. + external set disableRemotePlayback(bool disabled); + external set controlsList(String? controlsList); } diff --git a/packages/video_player/video_player_web/lib/src/video_player.dart b/packages/video_player/video_player_web/lib/src/video_player.dart index 012463fc780d..72f4b7dc155b 100644 --- a/packages/video_player/video_player_web/lib/src/video_player.dart +++ b/packages/video_player/video_player_web/lib/src/video_player.dart @@ -240,11 +240,11 @@ class VideoPlayer { _videoElement.controls = true; final String controlsList = options.controls.controlsList; if (controlsList.isNotEmpty) { - _videoElement.controlsList = controlsList.toJS; + _videoElement.controlsList = controlsList; } if (!options.controls.allowPictureInPicture) { - _videoElement.disablePictureInPicture = true.toJS; + _videoElement.disablePictureInPicture = true; } } @@ -254,7 +254,7 @@ class VideoPlayer { } if (!options.allowRemotePlayback) { - _videoElement.disableRemotePlayback = true.toJS; + _videoElement.disableRemotePlayback = true; } } diff --git a/packages/video_player/video_player_web/pubspec.yaml b/packages/video_player/video_player_web/pubspec.yaml index dd876328b014..6b1e1887bca9 100644 --- a/packages/video_player/video_player_web/pubspec.yaml +++ b/packages/video_player/video_player_web/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_web description: Web platform implementation of video_player. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.3.0 +version: 2.3.1 environment: sdk: ^3.3.0