feat: 实现视频播放完成后自动切换下一个壁纸

- 在 VideoPlayer.VideoPlayerCallback 的 onCompletion() 中实现自动切换逻辑
- 视频播放完成后重置 isPlayingVideo 和 isLoadingWallpaper 状态
- 设置 forceChangeNext 标志并触发 drawWallpaper() 切换到下一个壁纸
- 添加详细的日志记录,便于调试视频切换流程

这使得视频壁纸播放完成后能够自动切换到下一个媒体,实现连续播放功能。

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hughhuangandClaude Sonnet 4.5 committed 2026-01-31 17:33:14 +08:00
1 parent 400029916c
commit 1ed8f6024d
1 file changed
+8
@@ -184,6 +184,14 @@ public class AutoWallpaperService extends WallpaperService {
@Override @Override
public void onCompletion() { public void onCompletion() {
Log.i(TAG, "Video playback completed, switching to next wallpaper");
fileLogger.log(TAG, "Video completed, triggering next wallpaper");
// 视频播放完成,标记为未播放状态
isPlayingVideo = false;
isLoadingWallpaper = false;
// 设置强制更换标志,触发下一个壁纸
forceChangeNext = true;
handler.post(() -> drawWallpaper());
} }
}); });
} }