Skip to content

Instantly share code, notes, and snippets.

@emersonsoares
Created May 10, 2012 05:06
Show Gist options
  • Save emersonsoares/2651142 to your computer and use it in GitHub Desktop.
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
<?php
//app/Controler/AppControler.php
public $helpers = array('Html', 'Video');
<?php
// app/View/MyController/myaction.ctp
echo $this->Video->embed('http://minhaurldovideo', array(
'width' => 450,
'height' => 300
));
<?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