【发布时间】:2011-11-09 15:40:15
【问题描述】:
我尝试通过按第一个结果不是收音机声音来收听来自网络的流媒体广播,当我将url地址输入函数play_radio时是否有任何错误。当我单击第二个按钮时,我设法收听了广播,但没有收听网络上的 windows 媒体播放器。
你能帮我找出函数 play_radio 的错误吗?谢谢。
<html>
<head>
<script type="text/javascript">
function play_radio(url)
{
'<object style="float: right;" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" width="220" height="50" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701">'+"\n"+
'<param name="align" value="center" />'+"\n"+
'<param name="url" value="'+url+'" />'+"\n"+
'<param name="src" value="'+url+'" /><embed style="float: right;" type="application/x-mplayer2" width="220" height="50" src="'+url+'" url="'+url+'" align="center"></embed></object>'
}
</script>
</head>
<body>
<table style="margin-left: auto; margin-right: auto;" border="1" cellspacing="1" cellpadding="10" align="center">
<tbody>
<tr>
<td><input type="button" value="radio 1" onclick="play_radio('http://www.elshinta.com/v2003a/elsh_streaming.asx')" /></td>
<td><input onclick="window.location.href='http://www.elshinta.com/v2003a/elsh_streaming.asx'" type="BUTTON" value="radio 2" /></td>
</tr>
</tbody>
</table>
</body>
</html>
【问题讨论】:
-
play_radio()函数不执行任何操作。它只是一个字符串文字。您必须将该 HTML 插入页面上的某个位置,以便浏览器对其进行解析。
标签: php html streaming radio windows-media-player