gpt4 book ai didi

javascript - 我无法创建视频缩略图

转载 作者:行者123 更新时间:2023-11-28 16:59:43 25 4
gpt4 key购买 nike

我的网站上有一个 iframe。我想创建视频的缩略图我在数据库中存储了 iframeurl。我想创建视频的缩略图我尝试了这段代码。

<img src="http://img.youtube.com/vi/_uQrJ0TkZlc/hqdefault.jpg" alt="" style="height:61px">

它工作得很好,但问题是我使用的 id 是(_uQrJ0TkZlc)它是静态的。我希望该 id 应该是动态的,它存在于我的数据库表中

这是我的 iframe

<iframe  style="width:10px;height:10px;" id="<?php echo $fetchorderdetails['id']?>" src="<?php echo $fetchorderdetails['video_links']?>rel=0&wmode=Opaque&enablejsapi=1;showinfo=0;" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

最佳答案

不存储嵌入视频的整个链接,只存储 ID。这样您就可以访问嵌入的视频以及缩略图链接。要将变量插入到字符串中,请使用 "<img src="http://img.youtube.com/vi/" . $id . "/hqdefault.jpg" alt="" style="height:61px">" 。请参阅https://www.php.net/manual/en/language.operators.string.php

关于javascript - 我无法创建视频缩略图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57901495/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com