@TOC
基础
1 知道了vlc的web控制接口
2 了解海阔视界小程序的编写规则
我们可以继续写自己的小程序了,go,go,go!
目标

基本界面就这样吧,想要啥功能以后再加,目的是要先能对付用。
源码
js:
var ip = getMyVar('vlc_ip', '')
var key = 'OjEyMzEyMw==' //123123 vlc web密码
var d = []
d.push({
col_type: 'input',
title: 'ip地址',
url: 'toast://填好就行,不用按!',
extra: {
defaultValue:getMyVar('vlc_ip',''),
onChange: "putMyVar('vlc_ip',input)"
}
})
d.push({
col_type: 'input',
title: '播放',
url: $.toString((key) => {
let ip=getMyVar('vlc_ip','')
if (ip == '') {
return 'toast://ip地址不能为空!'
}
ip = 'http://' + ip + ':8080/requests/status.xml?command=in_play&input=' + input
let h = fetch(ip , {
headers: {
'Authorization': 'Basic ' + key
}
})
return 'toast://已经投送,请稍候!'
}, key),
extra: {
defaultValue:getMyVar('video_url',''),
onChange: "putMyVar('video_url',input)"
}
})
d.push({
col_type: 'text_5',
title: '⏮',
})
d.push({
col_type: 'text_5',
title: '⏪',
})
d.push({
col_type: 'text_5',
title: '▶️',
url: $().lazyRule((ip, key) => {
ip = 'http://' + ip + ':8080/requests/status.xml?command=in_play&input='
let vurl = getMyVar('video_url', '')
if (vurl == '' || ip=='') {
return 'toast://ip或视频地址都不能为空!'
}
let h = fetch(ip + vurl, {
headers: {
'Authorization': 'Basic ' + key
}
})
return 'toast://播放上一集!'
},ip,key)
})
d.push({
col_type: 'text_5',
title: '⏩',
})
d.push({
col_type: 'text_5',
title: '⏭',
})
setResult(d)
说明:因为播放涉及到播放列表,先不整,所以有4个按钮没代码,今天的目标是,给ip和视频地址就能放,其他不重要!
到现在,两个播放按钮都可用,其他都是摆设,还有一个问题,就是播放时不一定是全屏模式,这个问题填个按钮就成,不过我前面没画,就下次再说吧!
2万+

被折叠的 条评论
为什么被折叠?



