Flash and HTML5 video player without any copyright on screen. Playlists support. Few styles. Based on free version of Uppod player. Support: FLV, MP4, AVI, MOV, RTMP, HTTP
Usage: Download and extract in: _yii_webroot/protected/extensions
Add this code in your view:
<?php
$this->widget('ext.Yiippod.Yiippod', array(
'video'=>"http://www.youtube.com/watch?v=qD2olIdUGd8", //if you don't use playlist
//'video'=>"http://www.youtube.com/watch?v=qD2olIdUGd8", //if you use playlist
'id' => 'yiippodplayer',
'autoplay'=>true,
'width'=>640,
'view'=>6,
'height'=>480,
'bgcolor'=>'#000'
));
?>
Where:
'video' => address to media file or video stream,
'id' => player id,
'autoplay' => autostrat (true/false),
'width' => player width,
'height' => player height,
'bgcolor' => player background color before player loading
'view'=> player styles integer form 1 to 6
Open Source Media Framework: If you want to use version with Open Source Media Framework or Open Source Media Framework with HLS please rename ext/Yiippod/assets/uppod-osmf.swf to ext/Yiippod/assets/uppod.swf or ext/Yiippod/assets/uppod-osmfhls.swf to ext/Yiippod/assets/uppod.swf
Playlist usage: If you want to add few video files in player, please edit this file: ext/Yiippod/assets/playlist.txt
{"playlist":[
{"comment":"First_file_or_stream_name","file":"URL_to_first_file_or_stream","poster":"some_img1.jpg"},
{"comment":"Second_file_or_stream_name","file":"URL_to_second_file_or_stream","poster":"some_img2.jpg"} ...
]}
And then you must delete 'video'=>"", or comment it in your view:
<?php
$this->widget('ext.Yiippod.Yiippod', array(
'id' => 'yiippodplayer',
'autoplay'=>true,
'width'=>640,
'view'=>6,
'height'=>480,
'bgcolor'=>'#000'
));
?>
New in 1.2 version:
- Autostart as option
New in 1.1 version:
Add playlists support
Add six styles
Support Open Source Media Framework, and Open Source Media Framework with HLS
Script working, Flash checking
If device is not supported flash, script returns html5 version of this player.
How to pass model attributes?
I want to display the video from database, that have been already stored..
How to fetch using Yiippod?
Selvakumar, two examples
If you stored one link for stream video, I recommed to you write method wich will return one string from your database whith link to stream. In view it seems like that:
$this->widget('ext.Yiippod.Yiippod', array( 'video'=>Settings::getRTMP(), // return link - rtmp://123.123.123/live 'id' => 'yiippodplayer', 'width'=>490, 'height'=>320, 'bgcolor'=>'#000' ));
In second case, you need send parameter with video link from your model like that:
$this->widget('ext.Yiippod.Yiippod', array( 'video'=>Yii::app()->request->baseUrl."/upload/news_media/".$model->play, 'id' => 'yiippodplayer', 'width'=>700, 'height'=>420, 'bgcolor'=>'#000' ));
$model->play return name of video file, for example test.flv wich must be upload in _/upload/newsmedia/ folder in my case.
i have the links in the database, how can i show the link in the 'video'='link'?
i have the links in the database, how can i show the link in the 'video'='link'? link should come from the database.
To prashanth.n
prashanth.n see http://www.yiiframework.com/extension/yiippod/#c15497
You must get link from DB and insert it into _'video'=>your_linkto.flv If you want show few videos on page, you can do like that on your view:
$vnum=0; foreach($model as $link) { $this->widget('ext.Yiippod.Yiippod', array( 'video'=>$link->url, 'id' => 'yiippodplayer'.$vnum, 'width'=>490, 'height'=>320, 'bgcolor'=>'#000' )); $vnum++; }
Another good player
You can try my another video player: http://www.yiiframework.com/extension/yiinior/
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.