Question

A player: http://www.yvoschaap.com/videowall/

How can you customise the above Chromeless Youtube to have Play/Stop/Pause buttons?

Info on YouTube chromeless player provided by Google:

http://code.google.com/apis/youtube/chromeless_player_reference.html
http://code.google.com/apis/ajax/playground/?exp=youtube#chromeless_player

Was it helpful?

Solution

It says right at the top...

/*
 * Chromeless player has no controls.
 */

The way to add those links on the page that will play/pause/mute/unmute is as follows.

Add these functions to your page (you already have them there but under different names - either paste these in, or correct your existing code to match the examples offered int he Code Playground)

function playVideo() {
  if (ytplayer) {
    ytplayer.playVideo();
  }
}

function pauseVideo() {
  if (ytplayer) {
    ytplayer.pauseVideo();
  }
}

function muteVideo() {
  if(ytplayer) {
    ytplayer.mute();
  }
}

function unMuteVideo() {
  if(ytplayer) {
    ytplayer.unMute();
  }
}

To add those links to your page, add the following code to your site:

<a href="javascript:void(0);" onclick="playVideo();">Play</a>
<a href="javascript:void(0);" onclick="pauseVideo();">Pause</a>
<a href="javascript:void(0);" onclick="muteVideo();">Mute</a>
<a href="javascript:void(0);" onclick="unMuteVideo();">Unmute</a>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top