Yii 1.1: jyoutube

Easy intigration of Youtube videos and images in a webpage
7 followers

This widget encapsulates the jQuery youtube plugin for loading and handling Youtube videos and images in an easy an simple way.

Requirements

Yii 1.1.6 or above...

Usage

  • extract the file under .../protected/extensions
  • put in a view a code blocks like the following...
<h2>Youtoube Example - video</h2>
<?php $this->widget('ext.youtube.JYoutube', array(    
    'youtubeId'=>'otIJRaxaknc',
)); ?><!-- youtoube -->
 
<h2>Youtoube Example - clickable image</h2>
<?php $this->widget('ext.youtube.JYoutube', array(    
    'type'=>'image',
    'width'=>'400',
    'height'=>'300',
    'enableImageClickEvent'=>true,
    'youtubeId'=>'kXD6Gtinvbc',
    'options'=>array(
        'autohide'=>TRUE,
        'autoplay'=>TRUE,
        'showinfo'=>TRUE,
        )
)); ?><!-- youtoube -->
 
<h2>Youtoube Example - only image</h2>
<?php $this->widget('ext.youtube.JYoutube', array(
    'id'=>'youtube_1',
    'type'=>'image',
    'width'=>'300',
    'height'=>'200',
    'youtubeId'=>'DX1iplQQJTo',
)); ?>

Change log

Version 1.0

  • initial release

Version 1.1

  • added demo application
  • added minified javascript

Resources for the jQuery plugin

Alternative solution to this issue

Total 3 comments

#14631 report it
Johnny Gan at 2013/08/30 10:00am
Yiitube VS JYouTube

Both of them are easy to use. I used both of them, but like jyoutube more. Sometimes I need use video image (The 3rd example above).

#3400 report it
volkmar at 2011/04/10 05:22am
i don't get it o.o

I like javascript - this solution and build enterprise apps in intranets. So I can demant browser with javascript.

#3399 report it
nickcv at 2011/04/10 03:57am
i don't get it o.o

why use javascript for something like this?

Leave a comment

Please to leave your comment.

Create extension