Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.1

* Fix mixWithOthers test channel.

## 2.1.0

* Add VideoPlayerOptions with audo mix mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ abstract class VideoPlayerApiTest {
PositionMessage position(TextureMessage arg);
void seekTo(PositionMessage arg);
void pause(TextureMessage arg);
void setMixWithOthers(MixWithOthersMessage arg);
}

void VideoPlayerApiTestSetup(VideoPlayerApiTest api) {
Expand Down Expand Up @@ -225,6 +226,18 @@ void VideoPlayerApiTestSetup(VideoPlayerApiTest api) {
return {};
});
}
{
const BasicMessageChannel<dynamic> channel = BasicMessageChannel<dynamic>(
'dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers',
StandardMessageCodec());
channel.setMockMessageHandler((dynamic message) async {
final Map<dynamic, dynamic> mapMessage = message as Map<dynamic, dynamic>;
final MixWithOthersMessage input =
MixWithOthersMessage._fromMap(mapMessage);
api.setMixWithOthers(input);
return {};
});
}
}

class VideoPlayerApi {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A common platform interface for the video_player plugin.
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.1.0
version: 2.1.1

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class _ApiLogger implements VideoPlayerApiTest {
PositionMessage positionMessage;
LoopingMessage loopingMessage;
VolumeMessage volumeMessage;
MixWithOthersMessage mixWithOthersMessage;

@override
TextureMessage create(CreateMessage arg) {
Expand Down Expand Up @@ -50,6 +51,12 @@ class _ApiLogger implements VideoPlayerApiTest {
textureMessage = arg;
}

@override
void setMixWithOthers(MixWithOthersMessage arg) {
log.add('setMixWithOthers');
mixWithOthersMessage = arg;
}

@override
PositionMessage position(TextureMessage arg) {
log.add('position');
Expand Down Expand Up @@ -179,6 +186,16 @@ void main() {
expect(log.textureMessage.textureId, 1);
});

test('setMixWithOthers', () async {
await player.setMixWithOthers(true);
expect(log.log.last, 'setMixWithOthers');
expect(log.mixWithOthersMessage.mixWithOthers, true);

await player.setMixWithOthers(false);
expect(log.log.last, 'setMixWithOthers');
expect(log.mixWithOthersMessage.mixWithOthers, false);
});

test('setVolume', () async {
await player.setVolume(1, 0.7);
expect(log.log.last, 'setVolume');
Expand Down