mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Updated ExoPlayer to 2.13.3
This commit is contained in:
parent
9bc48c7800
commit
5c4520ea37
3 changed files with 9 additions and 3 deletions
|
|
@ -77,7 +77,7 @@ dependencies {
|
||||||
implementation "com.github.woltapp:blurhash:f41a23cc50"
|
implementation "com.github.woltapp:blurhash:f41a23cc50"
|
||||||
|
|
||||||
// Exoplayer
|
// Exoplayer
|
||||||
implementation 'com.google.android.exoplayer:exoplayer:2.12.2'
|
implementation 'com.google.android.exoplayer:exoplayer:2.13.3'
|
||||||
|
|
||||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
||||||
annotationProcessor "androidx.room:room-compiler:2.2.6"
|
annotationProcessor "androidx.room:room-compiler:2.2.6"
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,8 @@ public class MultiPlayer implements Playback {
|
||||||
|
|
||||||
MediaSourceFactory mediaSourceFactory = new UnknownMediaSourceFactory(buildDataSourceFactory());
|
MediaSourceFactory mediaSourceFactory = new UnknownMediaSourceFactory(buildDataSourceFactory());
|
||||||
exoPlayer = new SimpleExoPlayer.Builder(context).setMediaSourceFactory(mediaSourceFactory).build();
|
exoPlayer = new SimpleExoPlayer.Builder(context).setMediaSourceFactory(mediaSourceFactory).build();
|
||||||
|
// TODO: “Player is accessed on the wrong thread” suppressed
|
||||||
|
exoPlayer.setThrowsWhenUsingWrongThread(false);
|
||||||
|
|
||||||
exoPlayer.addListener(eventListener);
|
exoPlayer.addListener(eventListener);
|
||||||
exoPlayer.prepare();
|
exoPlayer.prepare();
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.cappielloantonio.play.service
|
||||||
|
|
||||||
import com.google.android.exoplayer2.MediaItem
|
import com.google.android.exoplayer2.MediaItem
|
||||||
import com.google.android.exoplayer2.drm.DrmSessionManager
|
import com.google.android.exoplayer2.drm.DrmSessionManager
|
||||||
|
import com.google.android.exoplayer2.drm.DrmSessionManagerProvider
|
||||||
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory
|
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory
|
||||||
import com.google.android.exoplayer2.source.MediaSource
|
import com.google.android.exoplayer2.source.MediaSource
|
||||||
import com.google.android.exoplayer2.source.MediaSourceFactory
|
import com.google.android.exoplayer2.source.MediaSourceFactory
|
||||||
|
|
@ -19,7 +20,6 @@ class UnknownMediaSourceFactory(dataSourceFactory: DataSource.Factory) : MediaSo
|
||||||
private val progressiveMediaSource : ProgressiveMediaSource.Factory
|
private val progressiveMediaSource : ProgressiveMediaSource.Factory
|
||||||
|
|
||||||
private var loadErrorHandlingPolicy: LoadErrorHandlingPolicy
|
private var loadErrorHandlingPolicy: LoadErrorHandlingPolicy
|
||||||
|
|
||||||
override fun setDrmSessionManager(drmSessionManager: DrmSessionManager?): MediaSourceFactory {
|
override fun setDrmSessionManager(drmSessionManager: DrmSessionManager?): MediaSourceFactory {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
@ -55,6 +55,10 @@ class UnknownMediaSourceFactory(dataSourceFactory: DataSource.Factory) : MediaSo
|
||||||
return sourceFactory.createMediaSource(mediaItem)
|
return sourceFactory.createMediaSource(mediaItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun setDrmSessionManagerProvider(drmSessionManagerProvider: DrmSessionManagerProvider?): MediaSourceFactory {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
private suspend fun httpGet(url: String?): String? {
|
private suspend fun httpGet(url: String?): String? {
|
||||||
return withContext(Dispatchers.IO) {
|
return withContext(Dispatchers.IO) {
|
||||||
val request = URL(url)
|
val request = URL(url)
|
||||||
|
|
@ -70,4 +74,4 @@ class UnknownMediaSourceFactory(dataSourceFactory: DataSource.Factory) : MediaSo
|
||||||
|
|
||||||
loadErrorHandlingPolicy = DefaultLoadErrorHandlingPolicy()
|
loadErrorHandlingPolicy = DefaultLoadErrorHandlingPolicy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue