2017 © Pedro PelĂĄez
 

library youtube-player-php

Create youtube player in PHP.

image

benjaminlazarecki/youtube-player-php

Create youtube player in PHP.

  • Monday, April 28, 2014
  • by blazarecki
  • Repository
  • 1 Watchers
  • 5 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

YoutubePlayerPHP Build Status

It's allow you to create a youtube player and render it., (*1)

How to use

Create a youtube player

<?php
$youtubePlayer = new YoutubePlayer();

Customize the youtube player

<?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)

It's ready to use

<?php
$youtubePlayer->renderContainer();
$youtubePlayer->renderJavaScript();

Those methods generate the html and the javascript to render the youtube player., (*4)

It's generate, (*5)



 Add some options

<?php
$youtubePlayer->setPlayerVar('autohide', 1);
$youtubePlayer->setPlayerVars(array(
    'controls' => 1,
    'autoplay' => 1,
    'loop'     => 0,
    'theme'    => 'light',
));

For all options see the official doc, (*6)

The Versions

28/04 2014

dev-master

9999999-dev

Create youtube player in PHP.

  Sources   Download

MIT

The Requires