Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[video_player] #60048 ios picture in picture #3500

Open
wants to merge 86 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
595d3df
#60048: Migration from flutter-plugins to flutter-packages
vanlooverenkoen Mar 20, 2023
4831f57
Updated doc
vanlooverenkoen Mar 20, 2023
976b630
Merged current main into ios pip
vanlooverenkoen Mar 20, 2023
a7d5dd5
#60048: Formatting
vanlooverenkoen Mar 20, 2023
876dfe8
Fixed formatting
vanlooverenkoen Mar 20, 2023
a4ca9e7
#60048: Updated the changelogs
vanlooverenkoen Mar 21, 2023
49f769a
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 3, 2023
5477f0b
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 15, 2023
0764e27
#60048: Updated comments related to docs & typo's
vanlooverenkoen Apr 15, 2023
65fdf65
Renamed setAutomaticallyStartPictureInPicture to setAutomaticallyStar…
vanlooverenkoen Apr 16, 2023
d4d9ff9
Updated starting to started to match stopped enum values
vanlooverenkoen Apr 17, 2023
ff6d02f
Removed some logic to pause
vanlooverenkoen Apr 17, 2023
ae7500a
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen May 10, 2023
4eeb6e1
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen May 11, 2023
9110d0f
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jun 22, 2023
211c6b3
Fixed the formatting & pigeon run
vanlooverenkoen Jun 22, 2023
5a8735b
Fixed documentation
vanlooverenkoen Jun 22, 2023
4583229
Updated the dto's to setup the picture in picture
vanlooverenkoen Jun 22, 2023
70284aa
Fixed documentation
vanlooverenkoen Jun 23, 2023
7289998
Fixed 2 bugs where the permissions were not correct and an issue with…
vanlooverenkoen Jun 23, 2023
ee96f77
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jun 23, 2023
da13c09
Fixed formatting & tests
vanlooverenkoen Jun 23, 2023
4d83a52
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jun 24, 2023
ac920fe
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jul 25, 2023
8394840
Fixed the version bumper for the the video_player itself
vanlooverenkoen Jul 25, 2023
19b1440
Fixed comments
vanlooverenkoen Jul 25, 2023
1963d27
Fixed some comments
vanlooverenkoen Jul 31, 2023
f71a27a
Fixed formaating
vanlooverenkoen Jul 31, 2023
b3e05a0
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jul 31, 2023
1325254
Fixed documentation
vanlooverenkoen Jul 31, 2023
72ba79a
Fixed comment on UIBackgroundModes
vanlooverenkoen Aug 1, 2023
8c67ab8
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Aug 1, 2023
f935a16
Fixed a bug where the top & left overlay settings were incorrect
vanlooverenkoen Aug 1, 2023
42a7815
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Nov 25, 2023
fa93319
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Nov 25, 2023
b0103d0
updated documentation
vanlooverenkoen Nov 25, 2023
236ab51
fix ios tests
vanlooverenkoen Nov 25, 2023
1cf961d
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Dec 14, 2023
5c18256
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Mar 7, 2024
ddc7139
camera override video_player plugin
vanlooverenkoen Mar 7, 2024
45494b9
fix camera dependency overrides
vanlooverenkoen Mar 7, 2024
0597f32
fix macos implementation (only do validation on capabilities on iOS &…
vanlooverenkoen Mar 7, 2024
5c1f759
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Mar 8, 2024
e94ccaa
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Mar 11, 2024
9dc85a0
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 23, 2024
2b72605
fix formatting
vanlooverenkoen Apr 23, 2024
601c506
fix formatting & unwanted changes
vanlooverenkoen Apr 23, 2024
4574fa9
fix: remove the video_player dependency overrides
vanlooverenkoen Apr 23, 2024
1135695
fix: add the dependency override of video_player_avfoundation
vanlooverenkoen Apr 23, 2024
cd7fede
fix: add all the correct dependency overrides
vanlooverenkoen Apr 23, 2024
e9aba08
changelog version to specific version
vanlooverenkoen Apr 23, 2024
30c0b7a
Update pubspec.yaml
vanlooverenkoen Apr 23, 2024
c0ccbfc
Update pubspec.yaml
vanlooverenkoen Apr 23, 2024
8ee1dcb
fix: formatting of video_player
vanlooverenkoen Apr 23, 2024
58db59a
fix: compatability
vanlooverenkoen Apr 23, 2024
16ae8cb
fix: integervalue
vanlooverenkoen Apr 23, 2024
a15c3b7
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 23, 2024
87b92c2
fix: test on macOS
vanlooverenkoen Apr 23, 2024
5183028
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 24, 2024
002faa0
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 25, 2024
148cd55
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 25, 2024
d88cf33
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 25, 2024
45f96f5
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 26, 2024
9459bd5
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen May 8, 2024
d9f883b
fix formatting
vanlooverenkoen May 8, 2024
c9993dc
fix: macos checks
vanlooverenkoen May 8, 2024
3e401c1
fix: comment
vanlooverenkoen May 8, 2024
b250e9c
fix: check on macOS where there are no capabilities required to use p…
vanlooverenkoen May 8, 2024
01aaf8d
Revert "fix: add all the correct dependency overrides"
Nols1000 Jan 2, 2025
ee6db47
Revert "camera override video_player plugin"
Nols1000 Jan 2, 2025
2e3196b
Update the documentation on configuring the required ios capabilities
Nols1000 Jan 2, 2025
29c1d3b
Merge remote-tracking branch 'origin/main' into feature/#60048-ios-pi…
Nols1000 Jan 2, 2025
6d8fb1e
[video_player_android] regenerate pigeons
Nols1000 Jan 2, 2025
114f5b8
[video_player_avfoundation] regenerate pigeons
Nols1000 Jan 2, 2025
5861e1d
Revert changes to the camera_android_camerax example
Nols1000 Jan 2, 2025
114f9ac
[video_player] fix todo making the picture-in-picture message const
Nols1000 Jan 2, 2025
3c1b4e6
[video_player] add tests to ensure equals implementation for isPictur…
Nols1000 Jan 2, 2025
3985a77
[video_player_avfoundation] refactor picture in picture extension
Nols1000 Jan 3, 2025
1649be4
[video_player_avfoundation] refactor code
Nols1000 Jan 3, 2025
bc56139
[video_player] format code
Nols1000 Jan 3, 2025
e1348c8
[video_player_avfoundation] reorder imports
Nols1000 Jan 3, 2025
7e70da0
[video_player] update version
Nols1000 Jan 3, 2025
4abe6f1
[video_player_android] Revert all changes made to this package
Nols1000 Jan 3, 2025
2006494
[video_player] upgrade dependencies
Nols1000 Jan 3, 2025
58dabf4
[video_player] fix dependencies for example
Nols1000 Jan 3, 2025
881e80e
[video_player_android] add overwrite to fix analysis error
Nols1000 Jan 3, 2025
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
1 change: 1 addition & 0 deletions packages/video_player/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved

* Adds support for picture-in-picture on iOS.
* Updates minimum supported SDK version to Flutter 3.3/Dart 2.18.

## 2.6.1
Expand Down
25 changes: 25 additions & 0 deletions packages/video_player/video_player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,29 @@ and so on.

To learn about playback speed limitations, see the [`setPlaybackSpeed` method documentation](https://pub.dev/documentation/video_player/latest/video_player/VideoPlayerController/setPlaybackSpeed.html).

### Picture-in-Picture

#### iOS
On iOS the picture-in-picture is linked to the AVPlayerController.
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved
If you want to enable picture-in-picture make sure to enable the `audio` capability (in Xcode's UI it will say **Audio, AirPlay, and Picture in Picture**).
Not setting this capability but calling `setPictureInPictureOverlayRectMessage` and `setPictureInPicture` will not start the picture-in-picture.

```xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There needs to be something in the text just before this that says exactly what file(s) this is showing.

<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
```

Example:
![The example app running in iOS with picture-in-picture enabled](https://github.com/flutter/plugins/blob/main/packages/video_player/video_player/doc/demo_pip_iphone.gif?raw=true)

#### Android

On Android there is no link to the video player. Your complete app will be minimized ([picture-in-picture Android documentation](https://developer.android.com/guide/topics/ui/picture-in-picture))
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved

You have multiple options on Android:
- [simple_pip_mode](https://pub.dev/packages/simple_pip_mode)
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved
- Create your own plugin that follows the android documentation

Furthermore, see the example app for an example playback speed implementation.
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
87 changes: 85 additions & 2 deletions packages/video_player/video_player/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ class _BumbleBeeRemoteVideo extends StatefulWidget {
class _BumbleBeeRemoteVideoState extends State<_BumbleBeeRemoteVideo> {
late VideoPlayerController _controller;

final GlobalKey<State<StatefulWidget>> _playerKey =
GlobalKey<State<StatefulWidget>>();
final Key _pictureInPictureKey = UniqueKey();
bool _enableStartPictureInPictureAutomaticallyFromInline = false;

Future<ClosedCaptionFile> _loadCaptions() async {
final String fileContents = await DefaultAssetBundle.of(context)
.loadString('assets/bumble_bee_captions.vtt');
Expand Down Expand Up @@ -243,17 +248,95 @@ class _BumbleBeeRemoteVideoState extends State<_BumbleBeeRemoteVideo> {
children: <Widget>[
Container(padding: const EdgeInsets.only(top: 20.0)),
const Text('With remote mp4'),
FutureBuilder<bool>(
key: _pictureInPictureKey,
future: _controller.isPictureInPictureSupported(),
builder: (BuildContext context, AsyncSnapshot<bool> snapshot) =>
Text(snapshot.data ?? false
? 'Picture-in-picture is supported'
: 'Picture-in-picture is not supported'),
),
Row(
children: <Widget>[
const SizedBox(width: 16),
const Expanded(
child: Text(
'Start picture-in-picture automatically when going to background'),
),
Switch(
value: _enableStartPictureInPictureAutomaticallyFromInline,
onChanged: (bool newValue) {
setState(() {
_enableStartPictureInPictureAutomaticallyFromInline =
newValue;
});
_controller.setAutomaticallyStartsPictureInPicture(
enableStartPictureInPictureAutomaticallyFromInline:
_enableStartPictureInPictureAutomaticallyFromInline);
},
),
const SizedBox(width: 16),
],
),
MaterialButton(
color: Colors.blue,
onPressed: () {
final RenderBox? box =
_playerKey.currentContext?.findRenderObject() as RenderBox?;
if (box == null) {
return;
}
final Offset offset = box.localToGlobal(Offset.zero);
_controller.setPictureInPictureOverlaySettings(
settings: PictureInPictureOverlaySettings(
top: offset.dx,
left: offset.dy,
width: box.size.width,
height: box.size.height,
),
);
},
child: const Text('Set picture-in-picture overlay rect'),
),
MaterialButton(
color: Colors.blue,
onPressed: () {
if (_controller.value.isPictureInPictureActive) {
_controller.stopPictureInPicture();
} else {
_controller.startPictureInPicture();
}
},
child: Text(_controller.value.isPictureInPictureActive
? 'Stop picture-in-picture'
: 'Start picture-in-picture'),
),
Container(
padding: const EdgeInsets.all(20),
child: AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: Stack(
key: _playerKey,
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(_controller, allowScrubbing: true),
if (_controller.value.isPictureInPictureActive) ...<Widget>[
Container(color: Colors.white),
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already the case.

// ignore: prefer_const_constructors
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
Icon(Icons.picture_in_picture),
SizedBox(height: 8),
Text('This video is playing in picture-in-picture.'),
],
),
] else ...<Widget>[
VideoProgressIndicator(_controller, allowScrubbing: true),
_ControlsOverlay(controller: _controller),
],
],
),
),
Expand Down
8 changes: 8 additions & 0 deletions packages/video_player/video_player/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ flutter:
- assets/bumble_bee_captions.srt
- assets/bumble_bee_captions.vtt
- assets/Audio.mp3


# FOR TESTING ONLY. DO NOT MERGE.
dependency_overrides:
video_player:
path: ../../../video_player/video_player
video_player_platform_interface:
path: ../../../video_player/video_player_platform_interface
72 changes: 71 additions & 1 deletion packages/video_player/video_player/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ import 'package:video_player_platform_interface/video_player_platform_interface.
import 'src/closed_caption_file.dart';

export 'package:video_player_platform_interface/video_player_platform_interface.dart'
show DurationRange, DataSourceType, VideoFormat, VideoPlayerOptions;
show
DurationRange,
DataSourceType,
VideoFormat,
VideoPlayerOptions,
PictureInPictureOverlaySettings;

export 'src/closed_caption_file.dart';

Expand Down Expand Up @@ -48,6 +53,7 @@ class VideoPlayerValue {
this.isPlaying = false,
this.isLooping = false,
this.isBuffering = false,
this.isPictureInPictureActive = false,
this.volume = 1.0,
this.playbackSpeed = 1.0,
this.rotationCorrection = 0,
Expand Down Expand Up @@ -106,6 +112,9 @@ class VideoPlayerValue {
/// The current speed of the playback.
final double playbackSpeed;

/// True if picture-in-picture is currently active.
final bool isPictureInPictureActive;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vanlooverenkoen
Nice job, I'm in need of this feature.

I'm testing this pr in a project and I found a bug when updating this value. This property is not used in the bool operator ==(Object other) function, so it is not updated in the ValueNotifier. Can you fix this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn! Good catch!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like you added a Dart unit test to cover that change (i.e., one which would have caught this bug).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like you added a Dart unit test to cover that change (i.e., one which would have caught this bug).

This doesn't appear to have been resolved.


/// A description of the error if present.
///
/// If [hasError] is false this is `null`.
Expand Down Expand Up @@ -154,6 +163,7 @@ class VideoPlayerValue {
bool? isPlaying,
bool? isLooping,
bool? isBuffering,
bool? isPictureInPictureActive,
double? volume,
double? playbackSpeed,
int? rotationCorrection,
Expand All @@ -170,6 +180,8 @@ class VideoPlayerValue {
isPlaying: isPlaying ?? this.isPlaying,
isLooping: isLooping ?? this.isLooping,
isBuffering: isBuffering ?? this.isBuffering,
isPictureInPictureActive:
isPictureInPictureActive ?? this.isPictureInPictureActive,
volume: volume ?? this.volume,
playbackSpeed: playbackSpeed ?? this.playbackSpeed,
rotationCorrection: rotationCorrection ?? this.rotationCorrection,
Expand All @@ -192,6 +204,7 @@ class VideoPlayerValue {
'isPlaying: $isPlaying, '
'isLooping: $isLooping, '
'isBuffering: $isBuffering, '
'isPictureInPictureActive: $isPictureInPictureActive, '
'volume: $volume, '
'playbackSpeed: $playbackSpeed, '
'errorDescription: $errorDescription)';
Expand All @@ -210,6 +223,7 @@ class VideoPlayerValue {
isPlaying == other.isPlaying &&
isLooping == other.isLooping &&
isBuffering == other.isBuffering &&
isPictureInPictureActive == other.isPictureInPictureActive &&
volume == other.volume &&
playbackSpeed == other.playbackSpeed &&
errorDescription == other.errorDescription &&
Expand Down Expand Up @@ -441,6 +455,12 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
case VideoEventType.bufferingEnd:
value = value.copyWith(isBuffering: false);
break;
case VideoEventType.startedPictureInPicture:
value = value.copyWith(isPictureInPictureActive: true);
break;
case VideoEventType.stoppedPictureInPicture:
value = value.copyWith(isPictureInPictureActive: false);
break;
case VideoEventType.isPlayingStateUpdate:
value = value.copyWith(isPlaying: event.isPlaying);
break;
Expand Down Expand Up @@ -563,6 +583,56 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
await _videoPlayerPlatform.setVolume(_textureId, value.volume);
}

/// Returns true if picture-in-picture is supported on the device.
Future<bool> isPictureInPictureSupported() =>
_videoPlayerPlatform.isPictureInPictureSupported();

/// Enables/disables to start picture-in-picture automatically when the app goes to the background.
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved
Future<void> setAutomaticallyStartsPictureInPicture({
required bool enableStartPictureInPictureAutomaticallyFromInline,
}) async {
if (!value.isInitialized || _isDisposed) {
return;
}
await _videoPlayerPlatform.setAutomaticallyStartsPictureInPicture(
textureId: _textureId,
enableStartPictureInPictureAutomaticallyFromInline:
enableStartPictureInPictureAutomaticallyFromInline,
);
}

/// Sets the location of the video player view.
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved
/// So picture-in-picture can use it for animating.
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved
/// The rect will represent the location of the video player view in Flutter. The rect will be
/// passed to the platform to position the native picture-in-picture overlay correctly.
vanlooverenkoen marked this conversation as resolved.
Show resolved Hide resolved
Future<void> setPictureInPictureOverlaySettings({
required PictureInPictureOverlaySettings settings,
}) async {
if (!value.isInitialized || _isDisposed) {
return;
}
await _videoPlayerPlatform.setPictureInPictureOverlaySettings(
textureId: _textureId,
settings: settings,
);
}

/// Starts picture-in-picture mode.
Future<void> startPictureInPicture() async {
if (!value.isInitialized || _isDisposed) {
return;
}
await _videoPlayerPlatform.startPictureInPicture(_textureId);
}

/// Stops picture-in-picture mode.
Future<void> stopPictureInPicture() async {
if (!value.isInitialized || _isDisposed) {
return;
}
await _videoPlayerPlatform.stopPictureInPicture(_textureId);
}

Future<void> _applyPlaybackSpeed() async {
if (_isDisposedOrNotInitialized) {
return;
Expand Down
14 changes: 13 additions & 1 deletion packages/video_player/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter
widgets on Android, iOS, and web.
repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
version: 2.6.1
version: 2.7.0

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down Expand Up @@ -31,3 +31,15 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter


# FOR TESTING ONLY. DO NOT MERGE.
dependency_overrides:
video_player_android:
path: ../../video_player/video_player_android
video_player_avfoundation:
path: ../../video_player/video_player_avfoundation
video_player_platform_interface:
path: ../../video_player/video_player_platform_interface
video_player_web:
path: ../../video_player/video_player_web
20 changes: 20 additions & 0 deletions packages/video_player/video_player/test/video_player_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ class FakeController extends ValueNotifier<VideoPlayerValue>
Future<void> setClosedCaptionFile(
Future<ClosedCaptionFile>? closedCaptionFile,
) async {}

@override
Future<bool> isPictureInPictureSupported() async => true;

@override
Future<void> setAutomaticallyStartsPictureInPicture({
required bool enableStartPictureInPictureAutomaticallyFromInline,
}) async {}

@override
Future<void> setPictureInPictureOverlaySettings({
required PictureInPictureOverlaySettings settings,
}) async {}

@override
Future<void> startPictureInPicture() async {}

@override
Future<void> stopPictureInPicture() async {}
}

Future<ClosedCaptionFile> _loadClosedCaption() async =>
Expand Down Expand Up @@ -974,6 +993,7 @@ void main() {
'isPlaying: true, '
'isLooping: true, '
'isBuffering: true, '
'isPictureInPictureActive: false, '
'volume: 0.5, '
'playbackSpeed: 1.5, '
'errorDescription: null)');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ class MiniController extends ValueNotifier<VideoPlayerValue> {
case VideoEventType.isPlayingStateUpdate:
value = value.copyWith(isPlaying: event.isPlaying);
break;
case VideoEventType.startedPictureInPicture:
case VideoEventType.stoppedPictureInPicture:
case VideoEventType.unknown:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ flutter:
assets:
- assets/flutter-mark-square-64.png
- assets/Butterfly-209.mp4


# FOR TESTING ONLY. DO NOT MERGE.
dependency_overrides:
video_player_android:
path: ../../../video_player/video_player_android
video_player_platform_interface:
path: ../../../video_player/video_player_platform_interface
4 changes: 4 additions & 0 deletions packages/video_player/video_player_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
pigeon: ^9.2.5

dependency_overrides:
video_player_platform_interface:
path: ../../video_player/video_player_platform_interface
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT

* Adds support for picture-in-picture.
* Updates minimum supported SDK version to Flutter 3.3/Dart 2.18.

## 2.4.6
Expand Down
Loading