cacko/yii2-widget-video 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cacko/yii2-widget-video

最新稳定版本:0.1.6

Composer 安装命令:

composer require cacko/yii2-widget-video

包简介

Yii2 widget video

README 文档

README

yii2-widget-video

Yii2 widget for handling videos from:

  • youtube - videos and playlists
  • vimeo - can't remember, probably both
  • wistia - whatever, it's paid crap
  • brightcove - same as above
  • twitch - supports it all, there's obviously limitations on the livestreams etc, just use common sense
  • mp4 containers - as long as the browser supports it

it obviously relies on all the shite Yii2 decided to put as their defaults - bootshite, jQueer...etc

Demo

https://yii.cacko.net/video/widget it's just a form with all options, so you can test, it has a barbaric look and feel. Demo site source is at https://gitlab.com/cacko/yii2-widgets

Usage

VideoWidget::widget([
  'url' => 'https://www.youtube.com/watch?v=N4q2kBe82-o',
])

Options

  • url - mandatory
  • autoPlay - auto play the video. if using the new IE aka Chromium based browsers - you will most likely end up with muted video. the script will try its best ot play it with sound whenever possible. JUST DO NOT USE IT, IT IS STUPID IDEA.
  • hideContols - hides the native provder controls and puts volume and full screen only. genereraly the idea is combined with startTimestamp to make a a non live stream look like a stream. pretty much useless, since average joe can just open dev tools and remove the non touch events, anyway.
  • startTimestamp - when to start it, in Unix timestamp in seconds. Note that the timestamp comes from the server, but the wait is happening on the client browser, so if their's time is off, it will be off.
  • startPosition - from where to start the video, in seconds
  • openInModal - open the video in modal dialog
  • loop - rather pointless thing, but whatever, repeats the video or playlist after it ends.
  • placeholderImage - replaces the thumbnail from the video, in case you want to put your crappy logo to boost your genitals
  • placeholderEndImage - shows it after the video ends. logically if you use loop that will never show..capishe ?

combining some options can be nonse, again use common sense.

Setup

Instalation

just use composer, ok ? or better just write your own.

composer require cacko/yii2-widget-video

Screenshot persistance

the extension stores downloaded thumbnails in the system temp folder. If you want to change, set a dependency of Cacko\Yii2\Widgets\Video\Models\ScreenshotInterface. if you don't know how - RTFM.

Controller for captures

some providers or if you are using mp4 file, do not have api for screeshots, so it is done via the shite way and requires a controller endpoint. it points somewhere now, if you want to change it, same as above , DI -> Cacko\Yii2\Widgets\Video\Controller\ControllerInterface..etc

Yii::$container->set('Cacko\Yii2\Widgets\Video\Models\ScreenshotInterface', MyJunkPersistanceCrap::class);

Providers credentials

currently only youtube and twich require credentials, simply set a component definitions in the main app config.

    'components' => [

        'youtubeApi' => [
            'class' => 'Cacko\Yii2\Widgets\Video\Components\YouTube\Api',
            'youtubeKey' => 'xxxx',
        ],
        'twitchApi' => [
            'class' => 'Cacko\Yii2\Widgets\Video\Components\Twitch\Api',
            'clientId' => 'xxx',
            'secretId' => 'xxx',
        ]

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固