- Requirements
- Usage
- Youtube size values meaning:
- Megavideo size values meaning:
- Vimeo size values meaning:
- Veoh size values meaning:
This widget simply renders videos from youtube, megavideo, veoh and vimeo inside your pages.
Requirements ¶
works with Yii 1.1.5 or above.
Other versions were not tested.
Usage ¶
just put the extension inside your application extension directory and that's it.
Inside any of your view files just use this code:
$this->widget('ext.Yiitube', array('v' => 'fYa0y4ETFVo'));
You can set up to 3 parameters in this widget:
- player: is the player you want to use. Possible values are: youtube, megavideo, vimeo, veoh. Defaults to youtube.
- v: is the video code on the player. You can either put just the video code or the whole url. The widget will take care of parsing the entire string looking for the video code.
- hd: is a boolean value. This parameter is ignored by every player but youtube. With this value you can decide if you want youtube to display the video in high definition or not. Defaults to false.
- size: you can decide the size of your video thanks to this parameter. Size supports 4 different values: small, normal, big, huge. Defaults to normal.
Youtube size values meaning: ¶
- small 560x349
- normal 640x390
- big 853x510
- huge 1280x750
Megavideo size values meaning: ¶
- small 450x330
- normal 640x344
- big 800x430
- huge 1024x551
Vimeo size values meaning: ¶
- small 400x225
- normal 640x360
- big 800x450
- huge 1024x576
Veoh size values meaning: ¶
- small 410x340
- normal 615x510
- big 820x680
- huge 1025x850
thanks
Thanks, it's a useful extension. I just had problems with the youtube url parser, maybe you can try this one:
preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $this->v, $matches); return $matches[0];
This will account for
http://stackoverflow.com/questions/3392993/php-regex-to-get-youtube-video-id
Tested on v1.1.8
see ya!.
z-index problem
I had a problem with the z-index of a youtube video.
The video stays in front of a fancybox ...
The solution:
Added the param 'wmode=transparent' to the youtube url in the method youtubeVideoURL:
protected function youtubeVideoURL() { $url = "http://www.youtube.com/embed/{$this->v}?rel=0&wmode=transparent"; if ($this->hd) $url .= '&hd=1'; return $url; }
Please, fix VIMEO rendering
Hello!
Thanks for such useful extension.
Please, take a look at the VIMEO rendering function, it contains a fixed string point to a video. That should be fixed to something like
<iframe src="http://player.vimeo.com/video/{$this->v}?byline=0&portrait=0" width="{$this->_width[self::VIMEO][$this->size]}" height="{$this->_height[self::VIMEO][$this->size]}" frameborder="0"></iframe>
Thanks and regards!
is file corrupted ?
UPDATE :- I am able to download it using chrome , somehow firefox I was getting that error .
Thanks
Hi I am downloading it using my windows 7 laptop and see the file size is 2.2 KB and after downloading it , I am not able to open it using winzip . I am able to open other tgz files whatever I have .
Could you please help me on this ?
Thanks for your help
Regards
Yii Fan
thanks
thanks a lot for the comments guys, unfortunately lately i've been in development hell... asap i'll add your useful correction to the extension!
shared on github
I downloaded the extension and put it on github. So any registred user can contribute.
yiitube on github
I'll make some modifications next week probably.
Good extension to embed youtube, vimeo video
Really helpful to embed video on website. But one issue need to fix and that is downloading extension using Firefox browser. When I downloaded using Crome then extension extracted without showing any error.
Thanks nickcv for your approach.
Specify width and height
Any chance for an update to allow specification of the width and height directly vs. using the sizes?
Thanks
Sandy
great work
it show easy , i ever found
open .tgz archive problem
I can't extract code from downloaded .tgz archive
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.