mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 21:31:20 -08:00
优化整体结构
This commit is contained in:
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);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user