mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 19:01:20 -08:00
14 lines
406 B
JavaScript
14 lines
406 B
JavaScript
import { clamp, def } from '../utils';
|
|
|
|
export default function currentTimeMix(art, player) {
|
|
const { $video } = art.template;
|
|
|
|
def(player, 'currentTime', {
|
|
get: () => $video.currentTime || 0,
|
|
set: (time) => {
|
|
// Fixed: The provided double value is non-finite
|
|
$video.currentTime = clamp(parseFloat(time.toFixed(3)), 0, player.duration);
|
|
},
|
|
});
|
|
}
|