We do not need ExoPlayerWrapper anymore because we are not displaying the embedded controller.
This commit is contained in:
committed by
Benoit Marty
parent
caf8c7392e
commit
1aefa489ca
@@ -69,7 +69,6 @@ import io.element.android.libraries.mediaviewer.impl.local.LocalMediaViewState
|
||||
import io.element.android.libraries.mediaviewer.impl.local.PlayableState
|
||||
import io.element.android.libraries.mediaviewer.impl.local.rememberLocalMediaViewState
|
||||
import io.element.android.libraries.mediaviewer.impl.local.video.ExoPlayerForPreview
|
||||
import io.element.android.libraries.mediaviewer.impl.local.video.ExoPlayerWrapper
|
||||
import io.element.android.libraries.mediaviewer.impl.local.video.MediaPlayerControllerState
|
||||
import io.element.android.libraries.mediaviewer.impl.local.video.MediaPlayerControllerView
|
||||
import kotlinx.collections.immutable.toPersistentList
|
||||
@@ -91,7 +90,7 @@ fun MediaAudioView(
|
||||
} else {
|
||||
val context = LocalContext.current
|
||||
remember {
|
||||
ExoPlayerWrapper.create(context)
|
||||
ExoPlayer.Builder(context).build()
|
||||
}
|
||||
}
|
||||
ExoPlayerMediaAudioView(
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023, 2024 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.mediaviewer.impl.local.video
|
||||
|
||||
import android.content.Context
|
||||
import androidx.media3.common.Player
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.exoplayer.ExoPlayer
|
||||
|
||||
/**
|
||||
* Wrapper around ExoPlayer to disable some commands.
|
||||
* Necessary to hide the settings wheels from the player.
|
||||
*/
|
||||
@UnstableApi
|
||||
class ExoPlayerWrapper(private val exoPlayer: ExoPlayer) : ExoPlayer by exoPlayer {
|
||||
override fun isCommandAvailable(command: Int): Boolean {
|
||||
return availableCommands.contains(command)
|
||||
}
|
||||
|
||||
override fun getAvailableCommands(): Player.Commands {
|
||||
return exoPlayer.availableCommands
|
||||
.buildUpon()
|
||||
.remove(Player.COMMAND_SET_TRACK_SELECTION_PARAMETERS)
|
||||
.build()
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun create(context: Context): ExoPlayer {
|
||||
return ExoPlayerWrapper(
|
||||
ExoPlayer.Builder(context).build()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ fun MediaVideoView(
|
||||
} else {
|
||||
val context = LocalContext.current
|
||||
remember {
|
||||
ExoPlayerWrapper.create(context)
|
||||
ExoPlayer.Builder(context).build()
|
||||
}
|
||||
}
|
||||
ExoPlayerMediaVideoView(
|
||||
|
||||
Reference in New Issue
Block a user