diff --git a/app/build.gradle b/app/build.gradle index 2bb4e79b2..8ea671aac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -83,7 +83,7 @@ dependencies { implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.25' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'com.google.android.exoplayer:exoplayer-core:2.18.7' + implementation 'androidx.media3:media3-exoplayer:1.1.0' implementation 'com.google.vr:sdk-panowidget:1.180.0' implementation 'com.google.vr:sdk-videowidget:1.180.0' implementation 'org.apache.sanselan:sanselan:0.97-incubator' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index efc01f962..af22ede1d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -15,15 +15,16 @@ import android.util.DisplayMetrics import android.view.* import android.widget.RelativeLayout import android.widget.SeekBar -import com.google.android.exoplayer2.* -import com.google.android.exoplayer2.audio.AudioAttributes -import com.google.android.exoplayer2.source.DefaultMediaSourceFactory -import com.google.android.exoplayer2.source.MediaSource -import com.google.android.exoplayer2.source.ProgressiveMediaSource -import com.google.android.exoplayer2.upstream.ContentDataSource -import com.google.android.exoplayer2.upstream.DataSource -import com.google.android.exoplayer2.upstream.DataSpec -import com.google.android.exoplayer2.video.VideoSize +import androidx.media3.common.* +import androidx.media3.common.util.UnstableApi +import androidx.media3.datasource.ContentDataSource +import androidx.media3.datasource.DataSource +import androidx.media3.datasource.DataSpec +import androidx.media3.exoplayer.ExoPlayer +import androidx.media3.exoplayer.SeekParameters +import androidx.media3.exoplayer.source.DefaultMediaSourceFactory +import androidx.media3.exoplayer.source.MediaSource +import androidx.media3.exoplayer.source.ProgressiveMediaSource import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.extensions.* @@ -31,7 +32,7 @@ import com.simplemobiletools.gallery.pro.helpers.* import kotlinx.android.synthetic.main.activity_video_player.* import kotlinx.android.synthetic.main.bottom_video_time_holder.* -open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener, TextureView.SurfaceTextureListener { +@UnstableApi open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListener, TextureView.SurfaceTextureListener { private val PLAY_WHEN_READY_DRAG_DELAY = 100L private var mIsFullscreen = false diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index af8deaccf..a6baa9369 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -13,17 +13,18 @@ import android.widget.ImageView import android.widget.RelativeLayout import android.widget.SeekBar import android.widget.TextView +import androidx.media3.common.* +import androidx.media3.common.util.UnstableApi import com.bumptech.glide.Glide -import com.google.android.exoplayer2.* -import com.google.android.exoplayer2.audio.AudioAttributes -import com.google.android.exoplayer2.source.DefaultMediaSourceFactory -import com.google.android.exoplayer2.source.MediaSource -import com.google.android.exoplayer2.source.ProgressiveMediaSource -import com.google.android.exoplayer2.upstream.ContentDataSource -import com.google.android.exoplayer2.upstream.DataSource -import com.google.android.exoplayer2.upstream.DataSpec -import com.google.android.exoplayer2.upstream.FileDataSource -import com.google.android.exoplayer2.video.VideoSize +import androidx.media3.datasource.ContentDataSource +import androidx.media3.datasource.DataSource +import androidx.media3.datasource.DataSpec +import androidx.media3.datasource.FileDataSource +import androidx.media3.exoplayer.ExoPlayer +import androidx.media3.exoplayer.SeekParameters +import androidx.media3.exoplayer.source.DefaultMediaSourceFactory +import androidx.media3.exoplayer.source.MediaSource +import androidx.media3.exoplayer.source.ProgressiveMediaSource import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.gallery.pro.R @@ -40,7 +41,7 @@ import kotlinx.android.synthetic.main.pager_video_item.view.* import java.io.File import java.io.FileInputStream -class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, SeekBar.OnSeekBarChangeListener { +@UnstableApi class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, SeekBar.OnSeekBarChangeListener { private val PROGRESS = "progress" private var mIsFullscreen = false @@ -673,7 +674,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mPlayPauseButton.setImageResource(R.drawable.ic_play_outline_vector) activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) mPositionAtPause = mExoPlayer?.currentPosition ?: 0L - releaseExoPlayer() } private fun videoEnded(): Boolean {