Skip to content
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
6 changes: 6 additions & 0 deletions packages/video_player/video_player_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.7.4

* Fixes a [bug](https://github.com/flutter/flutter/issues/154559) where
resuming (or using a plugin like `share_plus` that implicitly resumes the
activity where) a video player would cause a `DecoderInitializationException`.

## 2.7.3

* Updates Media3-ExoPlayer to 1.4.1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ interface ExoPlayerProvider {

@RestrictTo(RestrictTo.Scope.LIBRARY)
public void onSurfaceCreated() {
exoPlayer = createVideoPlayer();
if (savedStateDuring != null) {
exoPlayer = createVideoPlayer();
savedStateDuring.restore(exoPlayer);
savedStateDuring = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,23 @@ public void onSurfaceProducerDestroyedAndRecreatedReleasesAndThenRecreatesAndRes
videoPlayer.dispose();
}

@Test
public void onSurfaceCreatedWithoutDestroyDoesNotRecreate() {
// Initially create the video player, which creates the initial surface.
VideoPlayer videoPlayer = createVideoPlayer();
verify(mockProducer).getSurface();

// Capture the lifecycle events so we can simulate onSurfaceCreated/Destroyed.
verify(mockProducer).setCallback(callbackCaptor.capture());
TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue();

// Calling onSurfaceCreated does not do anything, since the surface was never destroyed.
producerLifecycle.onSurfaceCreated();
verifyNoMoreInteractions(mockProducer);

videoPlayer.dispose();
}

@Test
public void disposeReleasesTextureAndPlayer() {
VideoPlayer videoPlayer = createVideoPlayer();
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/video_player_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player_android
description: Android implementation of the video_player plugin.
repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
version: 2.7.3
version: 2.7.4

environment:
sdk: ^3.5.0
Expand Down