Created
May 10, 2012 05:06
-
-
Save emersonsoares/2651142 to your computer and use it in GitHub Desktop.
CakePHP - VideoHelper um helper para gerar embed de videos a partir da url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//app/Controler/AppControler.php | |
public $helpers = array('Html', 'Video'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// app/View/MyController/myaction.ctp | |
echo $this->Video->embed('http://minhaurldovideo', array( | |
'width' => 450, | |
'height' => 300 | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Alguns desses parâmetros não servem para certos videos, ou seja, eles serão ignorados. | |
echo $this->Video->embed('http://minhaurldovideo', array( | |
'width' => 450, | |
'height' => 300, | |
'allowfullscreen'=>1, | |
'loop'=>1, | |
'color'=>'00adef', | |
'show_title'=>1, | |
'show_byline'=>1, | |
'show_portrait'=>0, | |
'autoplay'=>1, | |
'frameborder'=>0 | |
)) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment