调整进直播间loading界面与播放器绑定,播放器准备完成后再隐藏。

优化播放器加载速度1
This commit is contained in:
2023-01-08 15:50:40 +08:00
parent 9fcc04cef2
commit 27bd65d3da
4 changed files with 34 additions and 6 deletions

View File

@@ -106,7 +106,7 @@ public class LiveExoPlayerManager {
Log.i(TAG, "onPlaybackStateChanged 1: " + playbackState);
if (playbackState == Player.STATE_READY) {
player2.stop();
player2.setVideoSurface(null);
player2.clearVideoSurface();
player1.play();
Log.i(TAG, "切换播放器1");
handler.removeCallbacks(buffRunnable);
@@ -159,7 +159,7 @@ public class LiveExoPlayerManager {
Log.i(TAG, "onPlaybackStateChanged 2: " + playbackState);
if (playbackState == Player.STATE_READY) {
player1.stop();
player1.setVideoSurface(null);
player1.clearVideoSurface();
player2.play();
Log.i(TAG, "切换播放器2 " + player2.isPlaying());
handler.removeCallbacks(buffRunnable);