statikbe/craft-video-parser
Composer 安装命令:
composer require statikbe/craft-video-parser
包简介
Parse youtube & vimeo url's to make embeds
README 文档
README
This is a little plugin to get the ID from a youtube of vimeo URL, so that it can be used to create a video embed.
Usage
The plugin comes with a twig function that you use like this:
{% set video = craft.videoparser.parse(entry.video) %}
It returns an object with the following properties:
- Type (youtube or vimeo)
- ID
- embedSrc (specific to the type)
- extraParts (url parameters separated by an &)
Then you can create your own embed as you see fit.
<iframe src="{{ video.embedSrc }}{{ video.extraParts ? '?'~video.extraParts }}" frameborder="0" width="500" height="300"></iframe>
统计信息
- 总下载量: 21.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 5
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-11