分离播放器功能

This commit is contained in:
Harvey Zack committed 2018-11-05 14:11:25 +08:00
1 parent 3919ee2f3d
commit 617fd9681e
24 files changed
+671 -505

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { secondToTime } from '../utils';
export default function seekMix(art, player) {
Object.defineProperty(player, 'seek', {
value: time => {
const { refs: { $video }, notice } = art;
let newTime = Math.max(time, 0);
if ($video.duration) {
newTime = Math.min(newTime, $video.duration);
}
$video.currentTime = newTime;
notice.show(`${secondToTime(newTime)} / ${secondToTime($video.duration)}`);
art.emit('seek', newTime);
}
});
}