Remove auto decode

pull/586/head
FongMi 1 year ago
parent cdfd667fc9
commit c8cc4243ac
  1. BIN
      app/libs/youtube-release.aar
  2. 9
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/CastActivity.java
  3. 6
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  4. 6
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/VideoActivity.java
  5. 6
      app/src/main/java/com/fongmi/android/tv/player/Players.java
  6. 6
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  7. 6
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/VideoActivity.java
  8. 2
      gradle.properties

Binary file not shown.

@ -185,7 +185,6 @@ public class CastActivity extends BaseActivity implements CustomKeyDownCast.List
private void onDecode() {
mPlayers.toggleDecode(mBinding.exo);
setDecode();
onReset();
}
private void onTrack(View view) {
@ -268,7 +267,8 @@ public class CastActivity extends BaseActivity implements CustomKeyDownCast.List
@Subscribe(threadMode = ThreadMode.MAIN)
public void onRefreshEvent(RefreshEvent event) {
if (event.getType() == RefreshEvent.Type.SUBTITLE) mPlayers.setSub(Sub.from(event.getPath()));
if (event.getType() == RefreshEvent.Type.PLAYER) onReset();
else if (event.getType() == RefreshEvent.Type.SUBTITLE) mPlayers.setSub(Sub.from(event.getPath()));
}
@Subscribe(threadMode = ThreadMode.MAIN)
@ -321,9 +321,8 @@ public class CastActivity extends BaseActivity implements CustomKeyDownCast.List
private void onCheck(ErrorEvent event) {
if (event.getCode() == PlaybackException.ERROR_CODE_IO_UNSPECIFIED || event.getCode() >= PlaybackException.ERROR_CODE_PARSING_CONTAINER_MALFORMED && event.getCode() <= PlaybackException.ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED) mPlayers.setFormat(ExoUtil.getMimeType(event.getCode()));
else if (event.getCode() == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) mPlayers.seekTo(C.TIME_UNSET);
else mPlayers.toggleDecode(mBinding.exo);
mPlayers.setMediaItem();
setDecode();
else if (event.getCode() == PlaybackException.ERROR_CODE_DECODER_INIT_FAILED) mPlayers.init(mBinding.exo);
else onError(event);
}
private void onError(ErrorEvent event) {

@ -379,7 +379,6 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
private void onDecode() {
mPlayers.toggleDecode(mBinding.exo);
setDecode();
fetch();
}
private void hideUI() {
@ -747,9 +746,8 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
private void onCheck(ErrorEvent event) {
if (event.getCode() == PlaybackException.ERROR_CODE_IO_UNSPECIFIED || event.getCode() >= PlaybackException.ERROR_CODE_PARSING_CONTAINER_MALFORMED && event.getCode() <= PlaybackException.ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED) mPlayers.setFormat(ExoUtil.getMimeType(event.getCode()));
else if (event.getCode() == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) mPlayers.seekTo(C.TIME_UNSET);
else mPlayers.toggleDecode(mBinding.exo);
mPlayers.setMediaItem();
setDecode();
else if (event.getCode() == PlaybackException.ERROR_CODE_DECODER_INIT_FAILED) mPlayers.init(mBinding.exo);
else onError(event);
}
private void onError(ErrorEvent event) {

@ -831,7 +831,6 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List
private void onDecode() {
mPlayers.toggleDecode(mBinding.exo);
setDecode();
onRefresh();
}
private void onTrack(View view) {
@ -1121,9 +1120,8 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List
private void onCheck(ErrorEvent event) {
if (event.getCode() == PlaybackException.ERROR_CODE_IO_UNSPECIFIED || event.getCode() >= PlaybackException.ERROR_CODE_PARSING_CONTAINER_MALFORMED && event.getCode() <= PlaybackException.ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED) mPlayers.setFormat(ExoUtil.getMimeType(event.getCode()));
else if (event.getCode() == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) mPlayers.seekTo(C.TIME_UNSET);
else mPlayers.toggleDecode(mBinding.exo);
mPlayers.setMediaItem();
setDecode();
else if (event.getCode() == PlaybackException.ERROR_CODE_DECODER_INIT_FAILED) mPlayers.init(mBinding.exo);
else onError(event);
}
private void onError(ErrorEvent event) {

@ -34,6 +34,7 @@ import com.fongmi.android.tv.bean.Track;
import com.fongmi.android.tv.event.ActionEvent;
import com.fongmi.android.tv.event.ErrorEvent;
import com.fongmi.android.tv.event.PlayerEvent;
import com.fongmi.android.tv.event.RefreshEvent;
import com.fongmi.android.tv.impl.ParseCallback;
import com.fongmi.android.tv.impl.SessionCallback;
import com.fongmi.android.tv.player.exo.ExoUtil;
@ -110,6 +111,7 @@ public class Players implements Player.Listener, ParseCallback {
public void init(PlayerView exo) {
releasePlayer();
initExo(exo);
setMediaItem();
}
private void initExo(PlayerView exo) {
@ -147,6 +149,7 @@ public class Players implements Player.Listener, ParseCallback {
public void setFormat(String format) {
this.format = format;
setMediaItem();
}
public void setPosition(long position) {
@ -380,7 +383,8 @@ public class Players implements Player.Listener, ParseCallback {
}
public void setMediaItem() {
setMediaItem(headers, url, format, drm, subs, Constant.TIMEOUT_PLAY);
if (url == null) RefreshEvent.player();
else setMediaItem(headers, url, format, drm, subs, Constant.TIMEOUT_PLAY);
}
public void setMediaItem(String url) {

@ -400,7 +400,6 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
mPlayers.toggleDecode(mBinding.exo);
setR1Callback();
setDecode();
fetch();
}
private void onChoose() {
@ -800,9 +799,8 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
private void onCheck(ErrorEvent event) {
if (event.getCode() == PlaybackException.ERROR_CODE_IO_UNSPECIFIED || event.getCode() >= PlaybackException.ERROR_CODE_PARSING_CONTAINER_MALFORMED && event.getCode() <= PlaybackException.ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED) mPlayers.setFormat(ExoUtil.getMimeType(event.getCode()));
else if (event.getCode() == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) mPlayers.seekTo(C.TIME_UNSET);
else mPlayers.toggleDecode(mBinding.exo);
mPlayers.setMediaItem();
setDecode();
else if (event.getCode() == PlaybackException.ERROR_CODE_DECODER_INIT_FAILED) mPlayers.init(mBinding.exo);
else onError(event);
}
private void onError(ErrorEvent event) {

@ -765,7 +765,6 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
mPlayers.toggleDecode(mBinding.exo);
setR1Callback();
setDecode();
onRefresh();
}
private void onEnding() {
@ -1155,9 +1154,8 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
private void onCheck(ErrorEvent event) {
if (event.getCode() == PlaybackException.ERROR_CODE_IO_UNSPECIFIED || event.getCode() >= PlaybackException.ERROR_CODE_PARSING_CONTAINER_MALFORMED && event.getCode() <= PlaybackException.ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED) mPlayers.setFormat(ExoUtil.getMimeType(event.getCode()));
else if (event.getCode() == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) mPlayers.seekTo(C.TIME_UNSET);
else mPlayers.toggleDecode(mBinding.exo);
mPlayers.setMediaItem();
setDecode();
else if (event.getCode() == PlaybackException.ERROR_CODE_DECODER_INIT_FAILED) mPlayers.init(mBinding.exo);
else onError(event);
}
private void onError(ErrorEvent event) {

@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx8192m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
org.gradle.parallel=false
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn

Loading…
Cancel
Save