mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 03:17:46 -08:00
Update currentTimeMix.js
This commit is contained in:
1 parent
3b0f500438
commit
bb92f3dc3d
1 file changed
+5
-3
@@ -1,10 +1,12 @@
|
||||
import { clamp, def } from '../utils';
|
||||
|
||||
export default function currentTimeMix(art, player) {
|
||||
const { $video } = art.template;
|
||||
|
||||
def(player, 'currentTime', {
|
||||
get: () => art.template.$video.currentTime || 0,
|
||||
set: currentTime => {
|
||||
art.template.$video.currentTime = clamp(currentTime, 0, player.duration);
|
||||
get: () => $video.currentTime || 0,
|
||||
set: time => {
|
||||
$video.currentTime = clamp(time, 0, player.duration || Infinity);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user