1
- #MPC-HC Control
1
+ # MPC-HC Control
2
2
3
3
Basic control over [ Media Player Classic - Home Cinema] ( https://mpc-hc.org/ ) via http api.
4
4
@@ -9,8 +9,8 @@ Enable web interface in mpc-hc settings.
9
9
10
10
## Usage
11
11
12
- ```
13
- const {MpcControl} = require("../lib/index ");
12
+ ``` ts
13
+ const {MpcControl} = require (" mpc-hc-control " );
14
14
15
15
const mpcApi = new MpcControl (" localhost" , 13579 );
16
16
mpcApi .openFile (" c:\\ video.mkv" ));
@@ -20,93 +20,93 @@ mpcApi.setVolume(75);
20
20
## Methods list
21
21
22
22
Basic methods list:
23
- ```
23
+ ``` ts
24
24
/**
25
25
* @filePath - path to video file
26
26
*/
27
27
openFile (filePath : string ): Promise < any > ;
28
28
```
29
29
30
- ```
30
+ ``` ts
31
31
isPlaying (): Promise < boolean >
32
32
```
33
33
34
- ```
34
+ ``` ts
35
35
isPaused (): Promise < boolean >
36
36
```
37
37
38
- ```
38
+ ``` ts
39
39
isStopped (): Promise < boolean >
40
40
```
41
41
42
- ```
42
+ ``` ts
43
43
isMuted (): Promise < boolean >
44
44
```
45
45
46
- ```
46
+ ``` ts
47
47
getVolume (): Promise < number >
48
48
```
49
49
50
- ```
50
+ ``` ts
51
51
getPosition (): Promise < IPositionInfo >
52
52
```
53
53
54
- ```
54
+ ``` ts
55
55
play (): Promise < void >
56
56
```
57
57
58
- ```
58
+ ``` ts
59
59
pause (): Promise < void >
60
60
```
61
61
62
- ```
62
+ ``` ts
63
63
togglePlay (): Promise < void >
64
64
```
65
65
66
- ```
66
+ ``` ts
67
67
stop (): Promise < boolean >
68
68
```
69
69
70
- ```
70
+ ``` ts
71
71
toggleFullscreen (): Promise < void >
72
72
```
73
73
74
- ```
74
+ ``` ts
75
75
/**
76
76
* @position - new position in ms
77
77
*/
78
78
seek (position : number ): Promise < void >
79
79
```
80
80
81
- ```
81
+ ``` ts
82
82
/**
83
83
* @delta - delta from current position in ms
84
84
*/
85
85
async jump (delta : number ): Promise < void >
86
86
```
87
87
88
- ```
88
+ ``` ts
89
89
skipBack (): Promise < void >
90
90
```
91
91
92
92
```
93
93
skipForward(): Promise<void>
94
94
```
95
95
96
- ```
96
+ ``` ts
97
97
/**
98
98
* @volume - new volume in percents
99
99
*/
100
100
setVolume (volume : number ): Promise < void >
101
101
```
102
102
103
- ```
103
+ ``` ts
104
104
toggleMute (): Promise < void >
105
105
```
106
106
107
107
Also you can use:
108
108
109
- ```
109
+ ``` ts
110
110
/**
111
111
* @commandId - any mpc-hc supported command from commands/mpcCommands.ts
112
112
* @data - additional data provided in to api call
0 commit comments