我使用以下代码在使用 TailwindCSS 的 HTML 页面上嵌入 Twitch 流:
<section aria-labelledby="Live-Stream Video">
<!-- Add a placeholder for the Twitch embed -->
<div id="twitch-embed" phx-update="ignore"></div>
<!-- Load the Twitch embed script -->
<script src="https://player.twitch.tv/js/embed/v1.js"></script>
<!-- Create a Twitch.Player object. This will render within the placeholder div -->
<script type="text/javascript">
new Twitch.Player("twitch-embed", {
channel: "example",
width: "100%",
height: "100%",
autoplay: "true"
});
</script>
</div>
</section>
结果:
该视频未使用该视频的全部可能宽度(在 TailwindCSS 布局内)。我不知道那是多宽。我如何告诉 Twitch.Player 使用黑色区域边界内的任何空间?