Besides the already mentioned addPlayer method, the _play.control Namespace offers various Methods to control all current Instance (i.e. Players), controlled by nexxPLAY. The most obvious Method of this Scenario, the various "addPlayer*" Methods have already been discussed.
Instance Management
//verify, that the SDK is ready to use_play.control.sdkIsReady()
//get an Array of all Container Elements, that currently hold a nexxPLAY Instance._play.control.getInstances()
//check, if there are any active nexxPLAY Instances on the current Page._play.control.hasActiveInstances()
//will pause all Instances (except the exceptContainer).//if canBeResumed is set to true, the Players can be resumed._play.control.pauseAll(exceptContainer, canBeResumed)
//will continue all Instances (except the exceptContainer), if they have been paused (and are allowed to continue)._play.control.continueAll(exceptContainer)
//will remove the Player Instance from the current Container to a new Container_play.control.moveToContainer(CONTAINER-ID,TARGET-CONTAINER-ID)
//will update a Configuration, defined by Player Configuration_play.control.updateConfiguration(CONTAINER-ID,SETTING-KEY,UPDATED-VALUE)
The updateConfig Method does not support all Configuration Keys. Supported are primarily Settings for Ad URLs ad well as sharingDataand aspectRatio.
//will remove the nexxPLAY Instance from the given Container.//it stopCasting is set to true and the Player is currently casting, the Casting will be stopped too_play.control.removePlayer(CONTAINER-ID,stopCasting)
Instance Properties
//verify,if the given Container contains a nexxPLAY Instance_play.control.instanceExists(CONTAINER-ID)
//check, if the nexxPLAY Instance under the given Container is ready for Control_play.control.instanceIsReady(CONTAINER-ID)
//check, if the nexxPLAY Instance under the given Container is currently playing_play.control.instanceIsPlaying(CONTAINER-ID)
//check, if the nexxPLAY Instance under the given Container is currently playing an AD_play.control.instanceIsPlayingAd(CONTAINER-ID)
//check, if the nexxPLAY Instance under the given Container is currently in PopOut Mode_play.control.instanceIsInPopOut(CONTAINER-ID)
//check, if the nexxPLAY Instance under the given Container is currently in PiP Mode_play.control.instanceIsInPiP(CONTAINER-ID)
//check, if the nexxPLAY Instance under the given Container is currently actively connected to a Chromecast_play.control.instanceIsCasting(CONTAINER-ID)
Access Media Data of the Instance
//will return an Object of Metadata Information of the currently played Media Object of the nexxPLAY Instance under the given Container._play.control.getCurrentMedia(CONTAINER-ID)
//will return an Object of Metadata Information of the parent Item of the currently played Media Object.//if there is no parent Item, null will be returned._play.control.getCurrentMediaParent(CONTAINER-ID)
//will return an Object of the detail Playback State of the nexxPLAY Instance under the given Container.
_play.control.getCurrentPlaybackState(CONTAINER-ID)
//will return a Float, representing the current Play Position (in Seconds) of the currently played Media Object of the nexxPLAY Instance under the given Container._play.control.getCurrentTime(CONTAINER-ID)
//will return an Object of available Text Tracks of the currently played Media Object of the nexxPLAY Instance under the given Container, if available._play.control.getTextTracks(CONTAINER-ID)
//will return an Array of available Audio Tracks of the current Media Object._play.control.getAudioTracks(CONTAINER-ID)
//will return an Array of available Files, connected to the current Media Object_play.control.getConnectedFiles(CONTAINER-ID)
The Parameter CONTAINER-ID in all previous Examples can be skipped (or replaced by null), if only one Player is active. If the Parameter is omitted, nexxPLAY will automatically choose the first existing Player Instance.
SDK Settings
The following SDK Methods are rarely needed. They are mentioned for special Cases and should only be used, if advised by 3Q nexx.
//enable Debug Output on Production Players_play.config.enableDebug(filter);
//explicitely set a different Language, than the Page/the User uses_play.config.setLanguage(lang);
//manually set a Platform/Gateway String. This will influence the Player Behaviour and must be handled very carefully._play.config.setPlatform(platform);
//manually set a platformVariant. Usefull Values will be given by 3Q Nexx only._play.config.setPlatformVariant(platformVariant, platformVariantIndex=0);
//manually set a Delivery Partner Details. All Media Events will then report this Partner as Delivery Partner.//this is handled by nexxPLAY automatically normally._play.config.setDeliveryPartner(ID, hash, adRef);
//manually set a Affiliate Partner ID. All Media Events will then report this Partner as Delivery Partner.//this is handled by nexxPLAY automatically normally._play.config.setAffiliatePartner(ID, code='');
//manually set a Campaign ID. All Media Events will then report this Campaign._play.config.setCampaign(ID, code='');
//mark the current Page Context as Context Reference. This will be included in all Media Events for detailed Analysis Purposes._play.config.setContextReference(ref);
//manually set a Session Identifier. This should never be used, unless advised by 3Q nexx._play.config.setCid(ID);
//force the Player to use/not use SSL on the current Page (or App)_play.config.setSSL(true/false);
//controls a Page with multiple, independant Players. If set to true, the SDK will pause all other Players, if a new Player starts Playback_play.config.setAllowOnlyOnePlayerPlaing(true/false)
//manually override the PopOut Functionality of nexxPLAY. This should not be modified, if the User explicitley denied the Usage of PopOut Players_play.config.setUserAllowsPopout(bool)
//if the Page needs User Informations (for the Comment Addon for example), but will not use the nexxOMNIA User Management_play.config.setExternalUser(externalRef, name, email, thumb);
User Preferences, GDPR and Consent Management
In any TCF 2.0 compliant Frontends, nothing has to be done manually, if the Player needs ConsentStrings for Ad Requests. It is fully handled by the Player itself.
For manual Purposes though, Consent Management can be applied by calling the following Functionalities:
//manually set a ConsentString for Ad Requests_play.config.setUserConsentString(cs)
//define a boolean Version of Consent Management by explicitely forbid Tracking_play.config.setUserIsTrackingOptOuted()
Please compare this with the general Description of GDPR and TCF 2.0 here: