修复重复切换分辨率会同时播放问题

This commit is contained in:
zlzw 2023-01-10 17:59:53 +08:00
parent 7bffdda6b9
commit 9f9c02b7e7

View File

@ -157,6 +157,9 @@ public class LiveExoPlayerManager {
mainView.setPlayer(player1); mainView.setPlayer(player1);
status = MODEL_PLAY1; status = MODEL_PLAY1;
isSwitchUrl = false; isSwitchUrl = false;
if(getNextPlayer().isPlaying()){
getNextPlayer().stop();
}
if (listener != null) { if (listener != null) {
listener.onIsPlayingChanged(true); listener.onIsPlayingChanged(true);
} }
@ -224,6 +227,9 @@ public class LiveExoPlayerManager {
//ToastUtil.show(String.format(Locale.CHINA, "从加载到播放 = %.3f,最大耗时 = %.3f", tmp, log_buffer_max_time)); //ToastUtil.show(String.format(Locale.CHINA, "从加载到播放 = %.3f,最大耗时 = %.3f", tmp, log_buffer_max_time));
log_buffer_time = -1; log_buffer_time = -1;
status = MODEL_PLAY2; status = MODEL_PLAY2;
if(getNextPlayer().isPlaying()){
getNextPlayer().stop();
}
isSwitchUrl = false; isSwitchUrl = false;
if (listener != null) { if (listener != null) {
listener.onIsPlayingChanged(true); listener.onIsPlayingChanged(true);