Skip to content
Closed
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,6 +1,8 @@
## NEXT
## 6.7.0

* Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.
* Adds `enablePictureInPicture()`, `disablePictureInPicture()`, `startPictureInPicture()`, `stopPictureInPicture()`, `isPictureInPictureSupported()`, and `isPictureInPictureActive()` methods for Picture-in-Picture support.
* Adds `pipStarted`, `pipStopped`, and `pipRestoreUserInterface` event types to `VideoEventType`.

## 6.6.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,48 @@ abstract class VideoPlayerPlatform extends PlatformInterface {
bool isAudioTrackSupportAvailable() {
return false;
}

/// Enables Picture-in-Picture for the given player.
Future<void> enablePictureInPicture(int playerId) {
throw UnimplementedError(
'enablePictureInPicture() has not been implemented.',
);
}

/// Disables Picture-in-Picture for the given player.
Future<void> disablePictureInPicture(int playerId) {
throw UnimplementedError(
'disablePictureInPicture() has not been implemented.',
);
}

/// Starts Picture-in-Picture mode for the given player.
Future<void> startPictureInPicture(int playerId) {
throw UnimplementedError(
'startPictureInPicture() has not been implemented.',
);
}

/// Stops Picture-in-Picture mode for the given player.
Future<void> stopPictureInPicture(int playerId) {
throw UnimplementedError(
'stopPictureInPicture() has not been implemented.',
);
}

/// Returns whether Picture-in-Picture is supported on this device.
Future<bool> isPictureInPictureSupported(int playerId) {
throw UnimplementedError(
'isPictureInPictureSupported() has not been implemented.',
);
}

/// Returns whether Picture-in-Picture is currently active for the given player.
Future<bool> isPictureInPictureActive(int playerId) {
throw UnimplementedError(
'isPictureInPictureActive() has not been implemented.',
);
}
}

class _PlaceholderImplementation extends VideoPlayerPlatform {}
Expand Down Expand Up @@ -355,6 +397,15 @@ enum VideoEventType {
/// phone calls, or other app media such as music players.
isPlayingStateUpdate,

/// Picture-in-Picture playback started.
pipStarted,

/// Picture-in-Picture playback stopped.
pipStopped,

/// The user tapped the restore button in the PiP window to return to the app.
pipRestoreUserInterface,

/// An unknown event has been received.
unknown,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/video_player/
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
# 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: 6.6.0
version: 6.7.0

environment:
sdk: ^3.9.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,64 @@ void main() {
test('default implementation isAudioTrackSupportAvailable returns false', () {
expect(initialInstance.isAudioTrackSupportAvailable(), false);
});

test(
'default implementation enablePictureInPicture throws unimplemented',
() async {
await expectLater(
() => initialInstance.enablePictureInPicture(1),
throwsUnimplementedError,
);
},
);

test(
'default implementation disablePictureInPicture throws unimplemented',
() async {
await expectLater(
() => initialInstance.disablePictureInPicture(1),
throwsUnimplementedError,
);
},
);

test(
'default implementation startPictureInPicture throws unimplemented',
() async {
await expectLater(
() => initialInstance.startPictureInPicture(1),
throwsUnimplementedError,
);
},
);

test(
'default implementation stopPictureInPicture throws unimplemented',
() async {
await expectLater(
() => initialInstance.stopPictureInPicture(1),
throwsUnimplementedError,
);
},
);

test(
'default implementation isPictureInPictureSupported throws unimplemented',
() async {
await expectLater(
() => initialInstance.isPictureInPictureSupported(1),
throwsUnimplementedError,
);
},
);

test(
'default implementation isPictureInPictureActive throws unimplemented',
() async {
await expectLater(
() => initialInstance.isPictureInPictureActive(1),
throwsUnimplementedError,
);
},
);
}