added LoadFile command
This commit is contained in:
parent
9baa6b17e7
commit
4b0dd8e5a6
19
commands.go
Normal file
19
commands.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package mpvipc
|
||||||
|
|
||||||
|
type LoadFileFlag string
|
||||||
|
|
||||||
|
const (
|
||||||
|
LoadFileReplace LoadFileFlag = "replace"
|
||||||
|
LoadFileAppend LoadFileFlag = "append"
|
||||||
|
LoadFileAppendPlay LoadFileFlag = "append-play"
|
||||||
|
)
|
||||||
|
|
||||||
|
func LoadFile(socket string, file string, flags LoadFileFlag) error {
|
||||||
|
if flags == "" {
|
||||||
|
flags = LoadFileReplace
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := &Command{[]interface{}{"loadfile", file, flags}}
|
||||||
|
_, err := SendCommand[any](socket, cmd)
|
||||||
|
return err
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user