Basic Integration

Load the SDK

The most easy approach is to load the nexxPLAY SDK File and prepare empty HTML Containers, which will be filled by the Player after the SDK has been loaded. After Loading the Script File, the nexxPlay Framework can be used.

With the JavaScript Embed method, the player can be configured and controlled completely from the main page via the _play namespace.

To embed the SDK, use the following Code:

<script src="https://arc.nexx.cloud/sdk/:domainid.play" type="text/javascript" crossorigin="anonymous"></script>

The :domainid Parameter is a numeric Value, given by 3Q

The SDK itself might download additional Scripts, so the complete Loading Process is an async Mechanism. The SDK will notify the surrounding Page via an Event on window , when the SDK is ready to use. As some older Browsers do not work well with addEventListener, another Option is to create a global Function onPlayReady, that the Player will automatically call, once the SDK is ready to use.

window.onPlayReady=function(){
    //nexxPLAY SDK is ready to use
}

window.addEventListener("nexxplay.ready", function(){
    //nexxPLAY SDK is ready to use
};

if((typeof(_play)=="object")&&(_play.control.sdkIsReady())){
    //nexxPLAY SDK is ready before Listeners were added
}

Depending on your Page Structure, the SDK may be initialized even before the Listener is added.

Adding a new Player Instance

The most simple Way to start a Media Player is to tell the SDK to fill an existing HTML Container.

_play.control.addPlayer(CONTAINER-ID, MEDIA-ID, STREAMTYPE, CONFIG);

CONTAINER-ID is the id of the target Container on the Page, that the Player will be inserted into. Please notice, that the Container should have a given width/height in either inline CSS or by a CSS Document to allow the Player to measure its Dimensions.

MEDIA-ID is the ID of an existing Media Object within nexxOMNIA

STREAMTYPE is the Type of the Media Object

The following STREAMTYPEValues are currently supported:

  • video

  • audio

  • live

  • radio

  • scene

  • playlist

  • audioalbum

  • rack

  • collection

  • set

Supported in the SDK (but not in iFrames) are also custom Lists of Media Types (MEDIA-ID is a comma seperated List in this Case):

  • videolist

  • audiolist

  • scenelist

Depending on the nexxPLAY Settings, controlled in nexxOMNIA, the Player will now automatically start inside the given Container.

The addPlayer Method will return a _play.PlayerInstance Object, which can be used to control the Player via JavaScript after Initialization.

CONFIG is a Configuration Object, that serves as “Override” Object. By using this, the Player can behave differently in this Instance than normally defined.

Last updated