Skip to content

Commit 74b1c0e

Browse files
committed
fix: old video keeps playing when switching to another single video
refs: #181
1 parent 9c80318 commit 74b1c0e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

package/contents/ui/main.qml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,16 @@ WallpaperItem {
177177
if (isLoading)
178178
return;
179179
videosConfig = getVideos();
180+
const wasPlaying = player.player.playing;
180181
// console.error(videoUrls);
181182
if (videosConfig.length == 0) {
182183
main.stop();
183184
main.currentSource.filename = "";
184-
} else {
185-
player.play();
185+
} else if (videosConfig.length == 1) {
186+
player.next(true, true);
187+
if (!wasPlaying) {
188+
main.pause();
189+
}
186190
}
187191
}
188192

0 commit comments

Comments
 (0)