drmonkeyninja / cakephp-video-helper
CakePHP 插件,用于嵌入 YouTube 和 Vimeo 视频
3.0.3
2018-02-09 12:38 UTC
Requires
- cakephp/cakephp: ~3.0
- dev-master
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0.0
- 2.x-dev
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6.2
- 2.0.6.1
- 2.0.6.0
- 2.0.5.1
- 2.0.5.0
- 2.0.4.1
- 2.0.4.0
- 2.0.3.0
- 2.0.2.0
- 2.0.1.0
- 2.0.0.0
- dev-docs/loading-helper
- dev-feature/showinfo
- dev-feature/add-showinfo-option-to-youtube
- dev-bug/large-youtube-thumbnail
- dev-bug/travisci-fix
- dev-dev
This package is auto-updated.
Last update: 2024-09-06 22:27:46 UTC
README
此插件提供视频助手,用于生成嵌入来自 YouTube、Vimeo、Dailymotion、BBC 播放器和 Wistia 的视频的标签。
要求
master
分支有以下要求:
- CakePHP 3.0.0 或更高版本。
- PHP 5.3.0 或更高版本。
VideoEmbed for CakePHP 2.x
如果您想在 2.x 应用程序中使用 VideoEmbed,可以使用插件的最新 2.x 版本(请参阅 2.x
分支)。
安装
可以使用 Composer 安装此插件:
composer require drmonkeyninja/cakephp-video-helper:3.*
或者将插件复制到您的 app/Plugin 目录,并将插件的目录重命名为 'VideoEmbed'。
然后,将以下行添加到您的 bootstrap.php 中以加载插件。
CakePlugin::load('VideoEmbed');
使用方法
echo $this->Video->embed($video['Video']['url'], array(
'width' => 450,
'height' => 300,
'failSilently' => true // Disables warning text when URL is not recognised
));
// Advanced usage
echo $this->Video->embed($video['Video']['url'], array(
'width' => 450,
'height' => 300,
'allowfullscreen' => 1,
'loop' => 1,
'color' => '00adef',
'show_title' => 1,
'show_byline' => 1,
'show_portrait' => 0,
'autoplay' => 1,
'frameborder' => 0
));
以下设置中,有些仅适用于 Vimeo,如果视频位于 YouTube、Dailymotion 或 Wistia,则会被忽略。