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; } }