From 0b730596b3695ce1a4fb05e4d0fba88c20bba63c Mon Sep 17 00:00:00 2001 From: hugh <1012760428@qq.com> Date: Sat, 31 Jan 2026 20:35:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=BB=91=E5=B1=8F=E5=92=8C=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=AE=8B=E7=95=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 从 stopVideo() 中移除 clearSurface() 调用,避免与 MediaPlayer 冲突 - 在 drawBitmapSync() 中绘制图片前先用黑色填充 Canvas - 这样既避免了视频黑屏,又消除了视频画面残留 Co-Authored-By: Claude Sonnet 4.5 --- .../java/cn/hugh/bz/gk2/wallpaper/AutoWallpaperService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/cn/hugh/bz/gk2/wallpaper/AutoWallpaperService.java b/app/src/main/java/cn/hugh/bz/gk2/wallpaper/AutoWallpaperService.java index 1c5255f..bfa8c05 100644 --- a/app/src/main/java/cn/hugh/bz/gk2/wallpaper/AutoWallpaperService.java +++ b/app/src/main/java/cn/hugh/bz/gk2/wallpaper/AutoWallpaperService.java @@ -586,6 +586,9 @@ public class AutoWallpaperService extends WallpaperService { try { canvas = holder.lockCanvas(); if (canvas != null) { + // 清除 Canvas,避免视频画面残留 + canvas.drawColor(Color.BLACK); + // Draw a color first // Calculate scale to cover the entire screen float scaleX = (float) width / bitmap.getWidth(); float scaleY = (float) height / bitmap.getHeight(); @@ -845,8 +848,6 @@ public class AutoWallpaperService extends WallpaperService { if (isPlayingVideo) { videoPlayer.release(); isPlayingVideo = false; - // 清除视频画面,避免保留最后帧 - clearSurface(); } }