20 lines
421 B
Go
20 lines
421 B
Go
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
|
|
}
|