优化整体结构

This commit is contained in:
Harvey Zack committed 2019-04-30 13:06:24 +08:00
1 parent 9f9cb0e036
commit 487e865017
34 files changed
+505 -427

No files matched your search

@@ -1,8 +1,14 @@
import { clamp, errorHandle } from '../utils';
export default function currentTimeMix(art, player) {
Object.defineProperty(player, 'currentTime', {
get: () => art.template.$video.currentTime || 0,
set: currentTime => {
art.template.$video.currentTime = currentTime;
errorHandle(
player.duration,
'Cannot set current time, the video seems to be not ready for mate information.',
);
art.template.$video.currentTime = clamp(currentTime, 0, player.duration);
},
});
}