dev-master
9999999-devCreate youtube player in PHP.
MIT
The Requires
- php >=5.3.0
- symfony/options-resolver dev-master
Wallogit.com
2017 © Pedro PelĂĄez
Create youtube player in PHP.
It's allow you to create a youtube player and render it., (*1)
<?php $youtubePlayer = new YoutubePlayer();
<?php
$youtubePlayer->setVideoId('IUGzY-ihqWc');
$youtubePlayer->setHtmlContainerId('player');
$youtubePlayer->setWidth(800);
$youtubePlayer->setHeight(600);
You can also customize the youtube player in constructor, (*2)
<?php
$youtubePlayer = new YoutubePlayer('u1zgFlCw8Aw', 800, 600, 'player');
By default if you call a the YoutubePlayer constructor without args, container id is 'player' width is set to 640 and height to 390., (*3)
<?php $youtubePlayer->renderContainer(); $youtubePlayer->renderJavaScript();
Those methods generate the html and the javascript to render the youtube player., (*4)
It's generate, (*5)
<?php
$youtubePlayer->setPlayerVar('autohide', 1);
$youtubePlayer->setPlayerVars(array(
'controls' => 1,
'autoplay' => 1,
'loop' => 0,
'theme' => 'light',
));
For all options see the official doc, (*6)
Create youtube player in PHP.
MIT