Skip to content

Commit f42aca3

Browse files
[video_player] Update ExoPlayer to 2.18.0 (flutter#6123)
1 parent 64ade14 commit f42aca3

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

packages/video_player/video_player_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.3.8
2+
3+
* Updates ExoPlayer to 2.18.0.
4+
15
## 2.3.7
26

37
* Bumps gradle version to 7.2.1.

packages/video_player/video_player_android/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ android {
4343
}
4444

4545
dependencies {
46-
implementation 'com.google.android.exoplayer:exoplayer-core:2.17.1'
47-
implementation 'com.google.android.exoplayer:exoplayer-hls:2.17.1'
48-
implementation 'com.google.android.exoplayer:exoplayer-dash:2.17.1'
49-
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.17.1'
46+
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.0'
47+
implementation 'com.google.android.exoplayer:exoplayer-hls:2.18.0'
48+
implementation 'com.google.android.exoplayer:exoplayer-dash:2.18.0'
49+
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.18.0'
5050
testImplementation 'junit:junit:4.13.2'
5151
testImplementation 'androidx.test:core:1.3.0'
5252
testImplementation 'org.mockito:mockito-inline:3.9.0'
@@ -65,4 +65,4 @@ android {
6565
}
6666
}
6767
}
68-
}
68+
}

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,41 +126,41 @@ private MediaSource buildMediaSource(
126126
Uri uri, DataSource.Factory mediaDataSourceFactory, String formatHint, Context context) {
127127
int type;
128128
if (formatHint == null) {
129-
type = Util.inferContentType(uri.getLastPathSegment());
129+
type = Util.inferContentType(uri);
130130
} else {
131131
switch (formatHint) {
132132
case FORMAT_SS:
133-
type = C.TYPE_SS;
133+
type = C.CONTENT_TYPE_SS;
134134
break;
135135
case FORMAT_DASH:
136-
type = C.TYPE_DASH;
136+
type = C.CONTENT_TYPE_DASH;
137137
break;
138138
case FORMAT_HLS:
139-
type = C.TYPE_HLS;
139+
type = C.CONTENT_TYPE_HLS;
140140
break;
141141
case FORMAT_OTHER:
142-
type = C.TYPE_OTHER;
142+
type = C.CONTENT_TYPE_OTHER;
143143
break;
144144
default:
145145
type = -1;
146146
break;
147147
}
148148
}
149149
switch (type) {
150-
case C.TYPE_SS:
150+
case C.CONTENT_TYPE_SS:
151151
return new SsMediaSource.Factory(
152152
new DefaultSsChunkSource.Factory(mediaDataSourceFactory),
153153
new DefaultDataSource.Factory(context, mediaDataSourceFactory))
154154
.createMediaSource(MediaItem.fromUri(uri));
155-
case C.TYPE_DASH:
155+
case C.CONTENT_TYPE_DASH:
156156
return new DashMediaSource.Factory(
157157
new DefaultDashChunkSource.Factory(mediaDataSourceFactory),
158158
new DefaultDataSource.Factory(context, mediaDataSourceFactory))
159159
.createMediaSource(MediaItem.fromUri(uri));
160-
case C.TYPE_HLS:
160+
case C.CONTENT_TYPE_HLS:
161161
return new HlsMediaSource.Factory(mediaDataSourceFactory)
162162
.createMediaSource(MediaItem.fromUri(uri));
163-
case C.TYPE_OTHER:
163+
case C.CONTENT_TYPE_OTHER:
164164
return new ProgressiveMediaSource.Factory(mediaDataSourceFactory)
165165
.createMediaSource(MediaItem.fromUri(uri));
166166
default:
@@ -246,7 +246,8 @@ void sendBufferingUpdate() {
246246

247247
private static void setAudioAttributes(ExoPlayer exoPlayer, boolean isMixMode) {
248248
exoPlayer.setAudioAttributes(
249-
new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build(), !isMixMode);
249+
new AudioAttributes.Builder().setContentType(C.AUDIO_CONTENT_TYPE_MOVIE).build(),
250+
!isMixMode);
250251
}
251252

252253
void play() {

packages/video_player/video_player_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: video_player_android
22
description: Android implementation of the video_player plugin.
33
repository: https://github.com/flutter/plugins/tree/main/packages/video_player/video_player_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
5-
version: 2.3.7
5+
version: 2.3.8
66

77
environment:
88
sdk: ">=2.14.0 <3.0.0"

0 commit comments

Comments
 (0)