Hello World

To use TOP, implement the following:

  1. Markup Creation
  2. Player Creation

Markup Creation

Add the following to your html page:

  1. A container div (into which the player will be attached)
  2. A script tag (src pointing to the TOP library)
<html>
    <head></head>
    <body>
        <div id="myVideoContainer">
            <!-- player will be attached here -->
        </div>
        <script src="//turnip.cdn.turner.com/top/core/1.2.1/default/top.sdk.min.js"></script>
    </body>
</html>

Player Creation

Create and initialize the player, listen for the playerReady event, and play content once it has fired (see examples):

var player = TOP.createAndInitPlayer({
    element: document.getElementById('myVideoContainer'),
    events: {
        playerReady : function(result) {
            this.play('//httpstream.ngtv.io/test/content/mp4/adultswim.mp4');
        }
    }
});