远程控制命令
命令说明
- 只监听了localhost,端口为:22234
- 不保证所有命令都正常工作
文件添加
{"ask":"fileadd", "instance":0, "path":"D:/VideoFiles/2.ts", "index":0}
path: 表示文件当前的位置
index:表示插入到里列表的位置,不填写或者是负数表示到末尾
返回值:
{"ask":"fileadd_rsp", "code":0, "msg":"OK"}
文件删除
{"ask":"filedelete", "instance":0, "index":0}
index:表示删除的文件位置,不填写或者负数表示删除末尾一个
返回值:
{"ask":"filedelete_rsp", "code":0, "msg":"OK"}
列表清空
{"ask":"listclear", "instance":0}
返回值:
{"ask":"listclear_rsp", "code":0, "msg":"OK"}
获取列表
{"ask":"listget", "instance":0}
返回值:
{"ask":"listget_rsp", "code":0, "msg":"OK",
"list":
[
{"file":"xxx.mp4"}
]
}
播放指定文件
{"ask":"fileopen", "instance":0, "index":0}
返回值:
{"ask":"fileopen_rsp", "code":0, "msg":"OK" }
开始播放
{"ask":"playstart", "instance":0}
seek为可选选项,单位ms
返回值:
{"ask":"playstart_rsp", "code":0, "msg":"OK" }
暂停/恢复播放
{"ask":"playpause", "instance":0}
返回值:
{"ask":"playpause_rsp", "code":0, "msg":"OK" }
停止播放
{"ask":"playstop", "instance":0}
返回值:
{"ask":"playstop_rsp", "code":0, "msg":"OK" }
播放跳转
{"ask":"seek", "instance":0, "seek":1000}
seek单位ms,
返回值:
{"ask":"seek_rsp", "code":0, "msg":"OK" }
移动窗口
{"ask":"movewindow", "instance":0, "fullscreen":false, "pos":"0,0,1280,720"}
返回值:
{"ask":"movewindow_rsp", "code":0, "msg":"OK" }
设置声音
{"ask":"setvolume", "instance":0, "mute":true, "value":60}
返回值:
{"ask":"setvolume_rsp", "code":0, "msg":"OK" }
设置提醒
{"ask":"setnotify", "instance":0, "mode":1,"port":12345, "addr":"127.0.0.1"}
mode:0 -->关闭提醒
mode:1 -->开启提醒,如果后续,如果addr的值为0.0.0.0,表示学习当前的地址和端口
返回值:
{"ask":"setnotify_rsp", "code":0, "msg":"OK" }
获取当前播放信息
{"ask":"playinfo", "instance":0}
返回值:
{"ask":"playinfo_rsp", "code":0, "msg":"OK" ,
"file":
{
"file":"xxx.mp4",
"status":"playing",
"current":10000
"total":50000
{
}
事件通知
开始播放提醒
{"notify":"playstart", "instance":0, "filaname":"123.mp4"}
{"notify":"playpause", "instance":0}
{"notify":"playresume", "instance":0}
{"notify":"playstop", "instance":0}