jeremy_vk/php_video_embedder
最新稳定版本:v0.0.4
Composer 安装命令:
composer require jeremy_vk/php_video_embedder
包简介
a librairy for embed videos from video platforms to your website, just with paste the video url
README 文档
README
This library simply return HTML embed code, just by passing the video url.
Requirements
This library required php >= 8.1 version
Getting started
Just run
composer require jeremy_vk/php_video_embedder
How to use it
Simply instance the EmbedMedia\Services\VideoEmbedder class
$videoEmbedder = new EmbedMedia\Services\VideoEmbedder(new EmbedMedia\Services\VideoPlatformResolver());
Or use the dependency injection
public function __construct (private VideoEmbedder $videoEmbedder){}
Here is an example of how to use the VideoEmbedder to embed video
$videoURL = "https://www.youtube.com/watch?v=dQw4w9WgXcQ55";
$embedCode = $videoEmbedder->embedVideo($videoURL);
echo $embedCode;
Should return
<iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ55" frameborder="0" allowfullscreen style="width: 100%; height: 100%"></iframe>
Three platforms are configured:
- Tiktok
- Youtube
If you want to contribute to this project, like add a new platform, you can open an issue to talk about it, or just open a pull request
统计信息
- 总下载量: 85
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-25