From 7e3e13ffbf817e24c282c33f8b27c556cc74a364 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] fix auto play --- package.json | 2 +- src/Controller.html | 7 +++++-- src/Player.html | 12 ------------ 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index a20bf023..ea647f9f 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "svelte": "^2.13.5" }, "dependencies": { - "rrweb": "file:../rrweb" + "rrweb": "^0.6.5" }, "scripts": { "build": "rollup -c", diff --git a/src/Controller.html b/src/Controller.html index df6f5fcc..3d395ea6 100644 --- a/src/Controller.html +++ b/src/Controller.html @@ -111,6 +111,7 @@ if (currentTime > 0) { replayer.resume(currentTime); } else { + this.set({ isPlaying: true }); replayer.play(currentTime); } }, @@ -135,8 +136,10 @@ onupdate({ changed, current, previous }) { if (current.replayer && !previous) { // auto play - this.set({ isPlaying: true }); - this.play(); + setTimeout(() => { + this.set({ isPlaying: true }); + }, 0); + current.replayer.play(0); current.replayer.on('pause', () => { this.set({ isPlaying: false }); }); diff --git a/src/Player.html b/src/Player.html index 0252a9ff..2c3e0a90 100644 --- a/src/Player.html +++ b/src/Player.html @@ -64,20 +64,8 @@ position: relative; background: white; float: left; - clear: both; border-radius: 5px; - } - - .rr-player::before { - content: ''; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; box-shadow: 0 24px 48px rgba(17, 16, 62, 0.12); - mix-blend-mode: multiply; - z-index: -1; } .rr-player__frame {