Use custom playback buttons

Wouldn't it be nice if you could start the video using your own custom buttons? Well you can! Simply hide the buttons on the player and create your own HTML buttons that control the Nimbb Player.

This example requires you to specify your developer key (see tutorial).

Example

play stop

HTML code

<script language="JavaScript" type="text/javascript">
<!--

// Global variable to hold player's reference.
var _Nimbb;

// Event: Nimbb Player has been initialized and is ready.
function Nimbb_initCompleted(idPlayer)
{
  // Get a reference to the player since it was successfully created.
  _Nimbb = document[idPlayer];
}

// Start playback.
function play()
{
  _Nimbb.playVideo();
}

// Stop playback.
function stop()
{
  _Nimbb.stopVideo();
}

// -->
</script>
<a href="javascript:play();">play</a>
<a href="javascript:stop();">stop</a>

<object id="nimbb" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="240" codebase= "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="http://player.nimbb.com/nimbb.swf?guid=XXXXXXXXXX&key=XXXXXXXXXX&lang=en&showmenu=0&playonclick=0" />
<param name="allowScriptAccess" value="always" />
<embed name="nimbb" src="http://player.nimbb.com/nimbb.swf?guid=XXXXXXXXXX&key=XXXXXXXXXX&lang=en&showmenu=0&playonclick=0" width="320" height="240" allowScriptAccess="always" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash">
</embed>
</object>

In this example, we introduce Events. The Nimbb Player triggers events that you can catch by simply defining some specific functions, like Nimbb_initCompleted(). This function is called by the player once it has been fully initiated. Note the idPlayer parameter containing the name of the player that called the event. Inside this function, we get a reference to the player in the _Nimbb variable. Then, in the play() and stop() functions, we are controlling the playback.

Another interesting aspect of this example is that we are hiding the buttons inside the Nimbb Player. This is done by setting showmenu and playonclick to false.

View more tutorials.

SIGN UP NOW 7-day free trial

Check out our Developer guide to get started with Nimbb.