Created
August 1, 2013 15:41
-
-
Save romaninsh/6132565 to your computer and use it in GitHub Desktop.
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 | |
// Add a player and link player's API with a button-click in PHP | |
$p=$this->add('View_VimeoPlayer'); | |
$this->add('Button')->js('click', $p->vimeo()->api('play')); | |
class View_VimeoPlayer extends View { | |
function init(){ | |
parent::init(); | |
$this->api->jquery->addStaticInclude('//a.vimeocdn.com/js/froogaloop2.min.js'); | |
$this->js(true,'window['.json_encode($this->getJSID()). | |
'] = $f($("#'.$this->getJSID(). | |
'")[0]);'); | |
} | |
/** | |
* provides access to vimeo player API | |
* http://developer.vimeo.com/player/js-api | |
*/ | |
function vimeo(){ | |
return $this->api->js()->_library('window['.json_encode($this->getJSID()).']'); | |
} | |
} |
looks very interesting and definitely it's new opportunity for some nice ATK add-ons
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
takes advantage of this commit: atk4/atk4@8f017a2