mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 18:11:20 -08:00
28 lines
547 B
JavaScript
28 lines
547 B
JavaScript
import { def, secondToTime } from '../utils'
|
|
|
|
export default function seekMix(art) {
|
|
const { notice } = art
|
|
|
|
def(art, 'seek', {
|
|
set(time) {
|
|
art.currentTime = time
|
|
if (art.duration) {
|
|
notice.show = `${secondToTime(art.currentTime)} / ${secondToTime(art.duration)}`
|
|
}
|
|
art.emit('seek', art.currentTime, time)
|
|
},
|
|
})
|
|
|
|
def(art, 'forward', {
|
|
set(time) {
|
|
art.seek = art.currentTime + time
|
|
},
|
|
})
|
|
|
|
def(art, 'backward', {
|
|
set(time) {
|
|
art.seek = art.currentTime - time
|
|
},
|
|
})
|
|
}
|