2017 © Pedro Peláez
 

yii2-extension yii2-you-tube-widget

Simple widget you tube for yii2

image

vision/yii2-you-tube-widget

Simple widget you tube for yii2

  • Tuesday, September 15, 2015
  • by visionp
  • Repository
  • 1 Watchers
  • 0 Stars
  • 371 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 6 % Grown

The README.md

Widget

Simple widget you tube for yii2, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist vision/yii2-you-tube-widget "dev-master"

or add, (*4)

"vision/yii2-you-tube-widget": "dev-master"

to the require section of your composer.json file., (*5)

Usage

Options: "https://developers.google.com/youtube/player_parameters?playerVersion=HTML5&hl=ru#playerapiid", (*6)

Events: "https://developers.google.com/youtube/js_api_reference?hl=ru#EventHandlers", (*7)

Once the extension is installed, simply use it in your code by :, (*8)

Minimum:, (*9)

= \vision\ytbwidget\YouTube::widget([
    'videoId' => 'OQQpukc_IM4'    
]) ?>



= \vision\ytbwidget\YouTube::widget([

    'videoId' => 'MA6tk7u44mM',
    
    'divId' => 'myDiv', //if set this option in js Globals you player is var player_myDiv, else player_{random val}
    
    'playerVars'=>[
    
        'modestbranding'=>1
        
    ],
    
    'events' => [
    
        'onStateChange' => 'function (event) {
        
            if (event.data == YT.PlayerState.PLAYING) {
            
                console.log("Playing..");
                
            }else if (event.data == YT.PlayerState.PAUSED){
            
                console.log("Paused..");
                
            }else{
            
                console.log("Buffering/Video Ended");
                
            }
            
        }'
        
    ]    
]) ?>

The Versions

15/09 2015

dev-master

9999999-dev

Simple widget you tube for yii2

  Sources   Download

MIT

The Requires

 

by Petrenko Aleksandr

yii2 you tube widgwt simple