From cb4d292016da3f263731072c50624309086db3cb Mon Sep 17 00:00:00 2001 From: Doikki Date: Fri, 1 Jul 2022 23:09:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=20ExoPlayer=20=E8=87=B3=202.?= =?UTF-8?q?18.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constants.gradle | 2 +- .../doikki/videoplayer/exo/ExoMediaSourceHelper.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/constants.gradle b/constants.gradle index 2676bc92..1ef8053e 100644 --- a/constants.gradle +++ b/constants.gradle @@ -7,7 +7,7 @@ project.ext { compileSdkVersion = 31 buildToolsVersion = '33.0.0' - exoPlayerVersion = '2.17.1' + exoPlayerVersion = '2.18.0' annotation = 'androidx.annotation:annotation:1.1.0' } \ No newline at end of file diff --git a/dkplayer-players/exo/src/main/java/xyz/doikki/videoplayer/exo/ExoMediaSourceHelper.java b/dkplayer-players/exo/src/main/java/xyz/doikki/videoplayer/exo/ExoMediaSourceHelper.java index 5b171eb2..b93bdd34 100644 --- a/dkplayer-players/exo/src/main/java/xyz/doikki/videoplayer/exo/ExoMediaSourceHelper.java +++ b/dkplayer-players/exo/src/main/java/xyz/doikki/videoplayer/exo/ExoMediaSourceHelper.java @@ -83,12 +83,12 @@ public MediaSource getMediaSource(String uri, Map headers, boole setHeaders(headers); } switch (contentType) { - case C.TYPE_DASH: + case C.CONTENT_TYPE_DASH: return new DashMediaSource.Factory(factory).createMediaSource(MediaItem.fromUri(contentUri)); - case C.TYPE_HLS: + case C.CONTENT_TYPE_HLS: return new HlsMediaSource.Factory(factory).createMediaSource(MediaItem.fromUri(contentUri)); default: - case C.TYPE_OTHER: + case C.CONTENT_TYPE_OTHER: return new ProgressiveMediaSource.Factory(factory).createMediaSource(MediaItem.fromUri(contentUri)); } } @@ -96,11 +96,11 @@ public MediaSource getMediaSource(String uri, Map headers, boole private int inferContentType(String fileName) { fileName = fileName.toLowerCase(); if (fileName.contains(".mpd")) { - return C.TYPE_DASH; + return C.CONTENT_TYPE_DASH; } else if (fileName.contains(".m3u8")) { - return C.TYPE_HLS; + return C.CONTENT_TYPE_HLS; } else { - return C.TYPE_OTHER; + return C.CONTENT_TYPE_OTHER; } }