📄 werslingplay.js
字号:
// JavaScript Document
var Msg_z="正在播放"
function Wplay(){
WerslingPlay.controls.play()
Msg_z="正在播放"
}
//播放
function Wstop(){
WerslingPlay.controls.stop()
Msg_z="停止"
}
//停止
function Wpause(){
WerslingPlay.controls.pause()
Msg_z="暂停"
}
//暂停
function showTime(){
var cp=WerslingPlay.controls.currentPosition
//播放秒
var cps=WerslingPlay.controls.currentPositionString
//播放时间
var dur=WerslingPlay.currentMedia.duration;
//总秒
var durs=WerslingPlay.currentMedia.durationString;
//总时间
var Times=""
if(dur>0){
Times= cps + "/" + durs
}else{
Times=""
}
if(cp>=durs){
clearTimeout(ShowMuisc);
}
//删除调用
//window.status = Times
window.document.Wersling.SetVariable("JSTxt", Msg_z +" "+ Times);
}
//getUrl("http://61.128.101.130:4080/song//k5/0088/5.wma")
function getUrl(Url){
WerslingPlay.URL=Url
load_In = setInterval('load_Music()',1000);
}
//地址
loadtime=0
//下载时间
function load_Music(){
window.document.Wersling.SetVariable("JSTxt", "加载歌曲中……")
loadtime++;
zsj=WerslingPlay.currentMedia.duration;
if (zsj>10) {
Msg_z="正在播放"
ShowMuisc=setInterval('showTime()',1000);
//循环调用
clearTimeout(load_In);
}
if (loadtime>=10 && zsj<1){
Msg_z="地址错误!"
window.document.Wersling.SetVariable("JSTxt", "地址错误!")
clearTimeout(load_In);
}
}
//检测歌曲下载
// -->
function Wersling_DOFSCommand(command,args){
if (command=="Play"){
Wplay()
}
if (command=="Stop"){
Wstop()
}
if (command=="Pause"){
Wpause()
}
if (command=="Url"){
getUrl(args)
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -