Commit d83b9e2
committed
fix #4211
Refactor: Optimize audio focus management
Refined the audio focus handling logic. The player now checks if it is actively playing before pausing on audio focus loss. This prevents inactive players from incorrectly responding to focus changes.
Additionally, audio focus is now requested when playback starts and properly released when the view is detached or videos are released. Also includes miscellaneous code cleanup and formatting.1 parent b1c9c77 commit d83b9e2
File tree
1 file changed
+9
-4
lines changed- gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base
1 file changed
+9
-4
lines changedLines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
394 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
395 | 398 | | |
396 | 399 | | |
397 | 400 | | |
| |||
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
406 | | - | |
407 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
408 | 413 | | |
409 | 414 | | |
410 | 415 | | |
| |||
0 commit comments