Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 1.34 KB

index.md

File metadata and controls

71 lines (53 loc) · 1.34 KB

MetisFW/Vimeo

Setup

  1. Register extension
extensions:
  vimeo: MetisFW\Vimeo\DI\VimeoExtension
  1. Set up extension parameters
vimeo:
  clientId:
  clientSecret:
  accessToken:    # [ OPTIONAL ]

Usage

Sample usage of VimeoContext
use Nette\Application\UI\Presenter;
use MetisWF\Vimeo\VimeoContext;

class MyPresenter extends Presenter {

  /** @var VimeoContext @inject */
  public $vimeo;

  public function foo() {
    // you obtain instance of `/Vimeo/Vimeo` so you can call all methods though API
    try {
      $connection = $this->vimeo->createConnection();
      ...
    } catch(\Exception $exception) {
      ...
    }
  }
}
Sample usage of VimeoPlayerControl
In Presenter
use MetisFW\Vimeo\UI\VimeoPlayerControl;
use Nette\Application\UI\Presenter;

class MyPresenter extends Presenter {

  public function createComponentVimeoPlayerControl(VimeoPlayerControlFactory $factory) {
    $control = $factory->create(666555);
    // autowired is possible but you have to register service - MetisFW\Vimeo\UI\VimeoPlayerControlFactory or
    $control = new VimeoPlayerControl(666555);

    // set different template if u want
    $control->setTemplateFilePath(__DIR__ . './myVimeoPlayerTemplate.latte');

    return $control;
  }
}
In latte
{control vimeoPlayerControl}