Skip to content

Commit 728129a

Browse files
authored
[Video_Player] Remove the deprecated API reference. (#3669)
1 parent a2c855d commit 728129a

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

packages/video_player/video_player/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.1
2+
3+
* Remove the deprecated API "exoPlayer.setAudioAttributes".
4+
15
## 2.0.0
26

37
* Migrate to null safety.

packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import android.content.Context;
77
import android.net.Uri;
8-
import android.os.Build;
98
import android.view.Surface;
109
import com.google.android.exoplayer2.C;
1110
import com.google.android.exoplayer2.ExoPlaybackException;
@@ -222,12 +221,8 @@ void sendBufferingUpdate() {
222221

223222
@SuppressWarnings("deprecation")
224223
private static void setAudioAttributes(SimpleExoPlayer exoPlayer, boolean isMixMode) {
225-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
226-
exoPlayer.setAudioAttributes(
227-
new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build(), !isMixMode);
228-
} else {
229-
exoPlayer.setAudioStreamType(C.STREAM_TYPE_MUSIC);
230-
}
224+
exoPlayer.setAudioAttributes(
225+
new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build(), !isMixMode);
231226
}
232227

233228
void play() {

packages/video_player/video_player/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: video_player
22
description: Flutter plugin for displaying inline video with other Flutter
33
widgets on Android, iOS, and web.
4-
version: 2.0.0
4+
version: 2.0.1
55
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player
66

77
flutter:

0 commit comments

Comments
 (0)