这是我的 iframe
<iframe
width="100vw"
className="video-frame"
title="Video"
src={url}
frameBorder="0"
controls="0"
autoplay="0"
showinfo="0"
allowFullScreen
/>
请提出一种方法,从我在网站中使用的 YouTube 播放器中删除下一个和上一个图标。
另外,是否有监听器在监听视频是否结束?
最佳答案
您可以访问 iframe 元素。
例如:
<iframe id="frameId" src="/abcd.html" style="height:380px;width:100%"></iframe>
然后在父级
var iframe = document.getElementById("myFrame");
var elmnt = iframe.contentWindow.document.getElementsById("closeBtn")[0];
elmnt.style.display = "none";
在 youTube 框架中找到关闭按钮 ID,然后根据您的要求更改属性
关于javascript - 我们如何从 YouTube iframe 中删除/隐藏下一个和上一个箭头图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58855620/