-
Notifications
You must be signed in to change notification settings - Fork 7
/
commands.ts
50 lines (37 loc) · 952 Bytes
/
commands.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import * as mpv from "./mpvHandler";
export async function playHandler(url: string) {
await mpv.play(url);
}
export async function jumpToPrevHandler() {
await mpv.jumpToPrev();
}
export async function jumpToNextHandler() {
await mpv.jumpToNext();
}
export async function pauseHandler() {
await mpv.pause();
}
export async function nextHandler() {
await mpv.next();
}
export async function prevHandler() {
await mpv.prev();
}
export async function resumeHandler() {
await mpv.resume();
}
export async function loadPlaylistHandler(filePath: string) {
await mpv.loadPlaylist(filePath);
await mpv.loopPlaylist('inf');
}
export async function openFolderHandler() {
}
export async function deteleTrackHandler() {
}
export async function quitMpv() {
await mpv.quitMpvNeeded();
}
export async function getTimePositionFormatted(): Promise<string> {
const timePos = await mpv.getTimePosition();
return timePos;
}