【发布时间】:2014-05-06 18:30:20
【问题描述】:
我需要为我的 IT 课程创建一个音乐网站 到目前为止,我拥有所有页面,但它必须包含一个直播电台页面
我想将 Capital FM 嵌入到该页面上
我所做的是将this webpage 添加到 iframe 中并将其设置为 0x0,因此它被隐藏了
<body>
<iframe width="0" scrolling="no" height="0" frameborder="0" src="http://www.capitalfm.com/london/on-air/player/" seamless="seamless">
<body>
现在,我必须有一个播放和暂停按钮,这样用户显然可以根据需要停止音乐。
我的问题,我将如何隐藏 iframe,但让播放和暂停按钮链接到它并停止它?
甚至让播放和暂停切换静音
谢谢
【问题讨论】:
-
关于您的具体问题,您可以使用按钮设置 - 或取消设置 - iframe src:
<button onclick="$('iframe").src=''">Pause</button><button onclick="$('iframe").src='http://www.capitalfm.com/london/on-air/player/'>Play</button>这将很容易,但如果您的父页面不是 https 则会有限制跨度>
标签: html iframe audio-player