简体   繁体   English

通过 PHP 以 HTML 格式将视频存储在 MySQL 输出中

[英]Store Videos in MySQL Output in HTML Via PHP

how do I put urls of videos in mysql and be able to call them by clicking on a thumbnail or button as well as in the webs of movies:我如何将视频的 url 放在 mysql 中,并能够通过单击缩略图或按钮以及在电影网络中调用它们:

第一张图片 第二张图片

You can simply create a column/field of type VARCHAR(300) called video_url that will be used to store the video URLs.您可以简单地创建一个名为video_url 的VARCHAR(300) 类型的列/字段,用于存储视频 URL。 Then you retrieve and play the videos in your HTML using the following code:然后使用以下代码检索并播放 HTML 中的视频:

<button onclick="document.getElementById('video_player').style.display='block'">
  Play Video
</button>

<video id="video_player" style="display:none;" width="320" height="240" controls autoplay>
  <source src="<?=video_url?>" type="video/mp4">
  Your browser does not support the video tag.
</video> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM