|
|
|
|
@ -32,6 +32,7 @@ import androidx.fragment.app.FragmentActivity; |
|
|
|
|
import androidx.lifecycle.Observer; |
|
|
|
|
import androidx.lifecycle.ViewModelProvider; |
|
|
|
|
import androidx.media3.common.C; |
|
|
|
|
import androidx.media3.common.PlaybackException; |
|
|
|
|
import androidx.media3.common.Player; |
|
|
|
|
import androidx.recyclerview.widget.RecyclerView; |
|
|
|
|
import androidx.viewbinding.ViewBinding; |
|
|
|
|
@ -367,7 +368,7 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setVideoView() { |
|
|
|
|
mPlayers.setup(mBinding.exo); |
|
|
|
|
mPlayers.init(mBinding.exo); |
|
|
|
|
if (isPort() && ResUtil.isLand(this)) enterFullscreen(); |
|
|
|
|
mBinding.control.action.decode.setText(mPlayers.getDecodeText()); |
|
|
|
|
mBinding.control.action.speed.setEnabled(mPlayers.canAdjustSpeed()); |
|
|
|
|
@ -1154,10 +1155,17 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo |
|
|
|
|
public void onErrorEvent(ErrorEvent event) { |
|
|
|
|
if (isRedirect()) return; |
|
|
|
|
if (mPlayers.retried()) onError(event); |
|
|
|
|
else if (event.isDecode()) onDecode(); |
|
|
|
|
else if (event.isDecode()) onCheck(event); |
|
|
|
|
else onRefresh(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onCheck(ErrorEvent event) { |
|
|
|
|
if (event.getCode() == PlaybackException.ERROR_CODE_DECODER_INIT_FAILED) mPlayers.init(mBinding.exo); |
|
|
|
|
else mPlayers.toggleDecode(mBinding.exo); |
|
|
|
|
setDecode(); |
|
|
|
|
onRefresh(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onError(ErrorEvent event) { |
|
|
|
|
mBinding.swipeLayout.setEnabled(true); |
|
|
|
|
Track.delete(getHistoryKey()); |
|
|
|
|
|