fix auto play

This commit is contained in:
Yanzhen Yu
2018-12-07 17:18:32 +08:00
parent b9130e8555
commit 8f78a3bfb6
3 changed files with 6 additions and 15 deletions

View File

@@ -16,7 +16,7 @@
"svelte": "^2.13.5"
},
"dependencies": {
"rrweb": "file:../rrweb"
"rrweb": "^0.6.5"
},
"scripts": {
"build": "rollup -c",

View File

@@ -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 });
});

View File

@@ -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 {