Skip to content

HTML5 SDK Players

hls.js

Downloads

In order to download the resources needed to use the System73 SDK, the following asset is provided from our CDN:


The following HTML5 code snippet shows how to include the System73 SDK for Hls.js in addition to the player scripts. The needed configuration for your application and player may differ from this. Please check the player's official documentation for any further details.

Notes

hls.js dependencies should be called always BEFORE the System73's SDK Service dependencies.

hls.js and System73 SDK dependencies should be always called BEFORE the video tag.

System73's hls.js plugin must be instantiated always BEFORE the hls.js loadSource call.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>System73 SDK Hls.js integration</title>

    <!-- hls.js should be always called BEFORE the System73 SDK dependencies -->
    <script src="//cdn.jsdelivr.net/npm/hls.js@latest" type="application/javascript"></script>

    <!-- hls.js and System73 SDK dependencies should be always called BEFORE the video tag. -->
    <script src="//cdn.s73cloud.com/4/s73-sdk-hlsjs.js" type="application/javascript"></script>

  </head>
  <body>
    <video id="video" autoplay muted controls></video>

    <script>
      var video = document.getElementById('video');
      if(Hls.isSupported()) {
          var s73SdkConfig = {
            apiKey: '<YOUR_API_KEY>', // mandatory
            contentSteering: '<YOUR_CONTENT_STEERING_RESOURCE>', // optional
            channelId: '<CHANNEL_ID>' // optional
          };
          var playerConfig = {
            // Add your custom player configuration here
          };

          var wrapper = S73HlsjsWrapper(s73SdkConfig);

          wrapper.wrapPlayerConfig(playerConfig);

          var player = new Hls(playerConfig);

          wrapper.wrapPlayer(player);

          player.loadSource('<MANIFEST_URL>');
          player.attachMedia(video);
      }
      // hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.
      // When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element throught the `src` property.
      // This is using the built-in support of the plain video element, without using hls.js.
      else if (video.canPlayType('application/vnd.apple.mpegurl')) {
          video.src = '<MANIFEST_URL>';
      }
    </script>
  </body>
</html>

The following parameters are used when performing an integration with System73's SDK:

  • (String)YOUR_API_KEY: is a required value, and it is used as the authentication key to access to the System73 SDK network.
  • (String)YOUR_CONTENT_STEERING_RESOURCE: is an optional value, and it is used as the content steering resource URI.
  • (String)CHANNEL_ID: is an optional value, and it is used as the identifier of the desired System73 SDK's channel.

Contact us in order to obtain it.


This section was last updated 2024-03-14