diff --git a/app/build.gradle b/app/build.gradle index 3b3821049..2eb26eec0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,6 +61,7 @@ dependencies { implementation project(':ijkplayer') pythonImplementation project(':pyramid') implementation project(':exoplayer-library') + implementation project(':exoplayer-extension-av1') implementation project(':exoplayer-extension-rtmp') implementation project(':exoplayer-extension-ffmpeg') implementation 'androidx.appcompat:appcompat:1.5.1' diff --git a/app/src/main/java/com/fongmi/android/tv/player/Players.java b/app/src/main/java/com/fongmi/android/tv/player/Players.java index df09aa053..1045a2328 100644 --- a/app/src/main/java/com/fongmi/android/tv/player/Players.java +++ b/app/src/main/java/com/fongmi/android/tv/player/Players.java @@ -1,7 +1,5 @@ package com.fongmi.android.tv.player; -import android.util.Size; - import androidx.annotation.NonNull; import com.fongmi.android.tv.App; @@ -114,13 +112,16 @@ public class Players implements Player.Listener, IMediaPlayer.OnInfoListener, IM return isExo() ? exoPlayer.isPlaying() : ijkPlayer.isPlaying(); } - public Size getSize() { - return isExo() ? new Size(exoPlayer.getVideoSize().width, exoPlayer.getVideoSize().height) : ijkPlayer.getSize(); + private int getVideoWidth() { + return isExo() ? exoPlayer.getVideoSize().width : ijkPlayer.getVideoWidth(); + } + + private int getVideoHeight() { + return isExo() ? exoPlayer.getVideoSize().height : ijkPlayer.getVideoHeight(); } public String getSizeText() { - Size size = getSize(); - return size.getWidth() + " x " + size.getHeight(); + return getVideoWidth() + " x " + getVideoHeight(); } public String getSpeedText() { diff --git a/ijkplayer/src/main/java/tv/danmaku/ijk/media/player/ui/IjkVideoView.java b/ijkplayer/src/main/java/tv/danmaku/ijk/media/player/ui/IjkVideoView.java index f95926833..bcdbb03dd 100644 --- a/ijkplayer/src/main/java/tv/danmaku/ijk/media/player/ui/IjkVideoView.java +++ b/ijkplayer/src/main/java/tv/danmaku/ijk/media/player/ui/IjkVideoView.java @@ -8,7 +8,6 @@ import android.net.Uri; import android.os.Build; import android.util.AttributeSet; import android.util.Log; -import android.util.Size; import android.view.Gravity; import android.widget.FrameLayout; import android.widget.MediaController; @@ -443,8 +442,12 @@ public class IjkVideoView extends FrameLayout implements MediaController.MediaPl this.mCurrentDecode = decode; } - public Size getSize() { - return new Size(mVideoWidth, mVideoHeight); + public int getVideoWidth() { + return mVideoWidth; + } + + public int getVideoHeight() { + return mVideoHeight; } @Override