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

[video_player] Ignore setting mixWithOthers in web #3561

Merged
merged 3 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/video_player/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.0-nullsafety.11

* Setting the `mixWithOthers` `VideoPlayerOptions` in web now is silently ignored instead of throwing an exception.

## 2.0.0-nullsafety.10

* Updated to video_player_platform_interface 4.0.
Expand Down
2 changes: 2 additions & 0 deletions packages/video_player/video_player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ This plugin compiles for the web platform since version `0.10.5`, in recent enou

Different web browsers may have different video-playback capabilities (supported formats, autoplay...). Check [package:video_player_web](https://pub.dev/packages/video_player_web) for more web-specific information.

The `VideoPlayerOptions.mixWithOthers` option can't be implemented in web, at least at the moment. If you use this option in web it will be silently ignored.

## Supported Formats

- On iOS, the backing player is [AVPlayer](https://developer.apple.com/documentation/avfoundation/avplayer).
Expand Down
4 changes: 2 additions & 2 deletions packages/video_player/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: video_player
description: Flutter plugin for displaying inline video with other Flutter
widgets on Android, iOS, and web.
version: 2.0.0-nullsafety.10
version: 2.0.0-nullsafety.11
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player

flutter:
Expand All @@ -25,7 +25,7 @@ dependencies:
# the constraints on the interface pins it.
# TODO(amirh): Revisit this (either update this part in the design or the pub tool).
# https://github.com/flutter/flutter/issues/46264
video_player_web: ^2.0.0-nullsafety.1
video_player_web: ^2.0.0-nullsafety.4

flutter:
sdk: flutter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ class DurationRange {
class VideoPlayerOptions {
/// Set this to true to mix the video players audio with other audio sources.
/// The default value is false
///
/// Note: This option will be silently ignored in the web platform (there is
/// currently no way to implement this feature in this platform).
final bool mixWithOthers;

/// set additional optional player settings
Expand Down
4 changes: 4 additions & 0 deletions packages/video_player/video_player_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.0-nullsafety.4

* Calling `setMixWithOthers()` now is silently ignored instead of throwing an exception.

## 2.0.0-nullsafety.3

* Updated to video_player_platform_interface 4.0.
Expand Down
4 changes: 4 additions & 0 deletions packages/video_player/video_player_web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ The Web platform does **not** suppport `dart:io`, so attempts to create a `Video
Playing videos without prior interaction with the site might be prohibited
by the browser and lead to runtime errors. See also: https://goo.gl/xX8pDD.

## Mixing audio with other audio sources

The `VideoPlayerOptions.mixWithOthers` option can't be implemented in web, at least at the moment. If you use this option it will be silently ignored.

## Supported Formats

**Different web browsers support different sets of video codecs.**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ class VideoPlayerPlugin extends VideoPlayerPlatform {
Widget buildView(int textureId) {
return HtmlElementView(viewType: 'videoPlayer-$textureId');
}

/// Sets the audio mode to mix with other sources (ignored)
@override
Future<void> setMixWithOthers(bool mixWithOthers) => Future<void>.value();
}

class _VideoPlayer {
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/video_player_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: video_player_web
description: Web platform implementation of video_player.
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_web
version: 2.0.0-nullsafety.3
version: 2.0.0-nullsafety.4

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,10 @@ void main() {
expect(VideoPlayerPlatform.instance.buildView(textureId),
isInstanceOf<Widget>());
});

test('ignores setting mixWithOthers', () {
expect(VideoPlayerPlatform.instance.setMixWithOthers(true), completes);
expect(VideoPlayerPlatform.instance.setMixWithOthers(false), completes);
});
});
}