六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 82|回复: 0

怎样用代码控制播放音乐暂停

[复制链接]

升级  6.67%

14

主题

14

主题

14

主题

秀才

Rank: 2

积分
60
 楼主| 发表于 2013-2-7 18:41:12 | 显示全部楼层 |阅读模式
怎样用代码控制播放音乐暂停
原址: http://www.lslnet.com/linux/dosc1/54/linux-366278.htm
[html]
<EMBED id=bgs src="http://phx.cz0550.com/music/never-say-goodbye.wma" width=200 height=100 border=0 autostart=true loop=true></EMBED>
<button onclick=bgs.pause()>pause</button>
<button onclick=bgs.play()>play</button>


<EMBED id=bgs2 src="http://phx.cz0550.com/music/never-say-goodbye.mp3" width=200 height=100 border=0 autostart=true loop=true></EMBED>
<button onclick=bgs2.pause()>pause</button>
<button onclick=bgs2.play()>play</button>
[/html]



renaski在上个帖子中说
     

谢谢了!您的方法只是将其静音,不是暂停。不过可以有声道选择真是太棒了,我以前还不知道可以这样控制呢!

[html]
<EMBED id=aa src="http://phx.cz0550.com/music/never-say-goodbye.wma" width=300 height=100 border=0 autostart=true loop=true></EMBED><br /><br />

声道切换:
<input type=button value=左声道 >
<input type=button value=立体声 >
<input type=button value=右声道 ><br /><br />
音量调节:
<input type=button value=音量最小 >
<input type=button value=音量最大 >
<input type=button value=音量+100 >
<input type=button value=音量+100 >
<input type=button value=音量-100 >
<input type=button value=音量-100 ><br /><br />
静音控制:
<input type=button value=开启静音 >
<input type=button value=关闭静音 >
<input type=button value="静音切换[未开启静音]" name="dd" ><br /><br />
播放控制:
<input type=button value=停止 >
<input type=button value=暂停 >
<input type=button value=播放 >
[/html]

不好意思,太粗心了。
[html]<EMBED id=bgs2 src="http://tsq.net.cn/muisc/rxq1/3.mp3" width=200 height=100 border=0 autostart=true loop=true>
<button onclick=bgs2.pause()>pause</button>
<button onclick=bgs2.play()>play</button>
[/html]
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表