Getting started with HISPlayer SDK

Basic usage of HISPlayer SDK is very easy:

  1. Create a simple HTML page with a div element.
  2. Assign a position and dimensions to the element.
  3. In your application's JavaScript -
    1. Create a HisPlayer object.
    2. Create a config.
    3. Provide the license key to the config object.
    4. Init the player.

Note: in order to get a license key send a request at the HISPlayer website.

<!DOCTYPE html>
<html>
  <head>
    <!-- HISPlayer library: -->
    <script src="hisplayer.js"></script>
    <!-- Your application source: -->
    <script src="myapp.js"></script>
  </head>
  <body>
    <div id="player" style="position:relative;width:640px;height:360px;"></div>
  </body>
</html>
// myapp.js

function initApp() {
  const player = new hisplayer.HisPlayer();
  const config = {
    licenseKey: <YOUR_LICENSE>,
    div: document.getElementById('player'),
    src: 'https://playertest.longtailvideo.com/adaptive/aes-with-tracks/master.m3u8',
    // Optionally enable the UI
    ui: {
      enabled: true,
    },
  };
  player.init(config);
}

document.addEventListener('DOMContentLoaded', initApp);