Skip to content

Commit 3d4da96

Browse files
CopilotCarGuo
andauthored
Fix fullscreen player requiring two clicks to resume from paused state (#4228)
* Initial plan * Fix fullscreen playback requiring two clicks after pausing: check listener identity in audio focus callbacks Co-authored-by: CarGuo <10770362+CarGuo@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: CarGuo <10770362+CarGuo@users.noreply.github.com>
1 parent 2d78d2d commit 3d4da96

File tree

1 file changed

+4
-2
lines changed
  • gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base

1 file changed

+4
-2
lines changed

gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,9 @@ public void run() {
391391
GSYVideoView.this.releaseVideos();
392392
} else {
393393
// 确保只有当前活跃的播放器才响应音频焦点变化
394+
// 防止全屏切换时,旧播放器的焦点丢失回调错误地暂停新的全屏播放器
394395
GSYMediaPlayerListener listener = getGSYVideoManager().listener();
395-
if (listener != null && getGSYVideoManager().isPlaying()) {
396+
if (listener != null && listener == GSYVideoView.this && getGSYVideoManager().isPlaying()) {
396397
listener.onVideoPause();
397398
}
398399
}
@@ -407,8 +408,9 @@ public void run() {
407408
public void onAudioFocusLossTransient() {
408409
try {
409410
// 确保只有当前活跃的播放器才响应音频焦点变化
411+
// 防止全屏切换时,旧播放器的焦点丢失回调错误地暂停新的全屏播放器
410412
GSYMediaPlayerListener listener = getGSYVideoManager().listener();
411-
if (listener != null && getGSYVideoManager().isPlaying()) {
413+
if (listener != null && listener == GSYVideoView.this && getGSYVideoManager().isPlaying()) {
412414
listener.onVideoPause();
413415
}
414416
} catch (Exception var2) {

0 commit comments

Comments
 (0)