收听来自网络的广播流
我尝试通过按来收听来自网络的流媒体广播,第一个结果不是广播声音,当我在函数 play_radio 中输入 url 地址时是否有任何错误。当我单击第二个按钮时,我设法收听广播,但不能从网络上的 Windows Media Player 收听广播。
你能帮我定位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>
I tried to listen to streaming radio from the web by pressing the first result is not a radio voice, is there any error when I enter the url address to the function play_radio. When I click the second button, I managed to listen to the radio but not from windows media player on the web.
Can you help me locate the errors of the function play_radio? Thanks.
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使其输出代码,玩家/对象是否会按预期工作,我不知道,但这是代码中的主要问题,因此您需要添加 document.write 或任何其他方式来输出该代码:
You need to make it output the code, whether the player/object would work as expected, I don't know, but that's the main issue in your code, so you need add document.write or any other way to output that code: