The Ambilightplayer can be created using the Ambilightplayer API. This is a simple way to initiate the player and set certain options & configurations.
Below is an example code you can paste into any HTML page. This is the simplest way of initiating the Ambilightplayer, providing only the required options
id and the
domain are required. The
id is needed as a container to hold the iframe. The
domain is needed for the api, the api needs to know which domain can be trusted when it receives calls to execute certain methods, etc.
||Required The id of the DOM-element where the amibilight will be created|
||Required The domain of where the HTML-file is hosted. We need to know which domain can be trusted for API-calls|
||The language the Ambilight-player should use.|
||The width for the Ambilightplayer-iframe. This can be specified as pixels or as a percentage.|
||The height for the Ambilightplayer-iframe. This can be specified as pixels or as a percentage.|
||Whether or not to automatically start playing video when the player starts.
Note autoplay will not work on iPad. Most mobile devices will require the user to manually start the video.
||Initial volume for the video (0-1). Use a comma value for values in between 0 and 1 (ex: 0.5 for 50% volume).|
||A callback function which is called once the API is ready to be used. This way you can avoid "function is undefined" errors.|
||This option determines if the learn-more button on the left-bottom of the screen is shown or not. A Boolean can be passed. True will show the button, false will hide it.|
||This option determines if the "See Ambilight TVs" button at bottom is show. A Boolean can be passed. True will show the button, false will hide it.|
||This option determines if the social sharing buttons on the right-bottom of the screen are shown or not. A Boolean can be passed. True will show the buttons, false will hide them.|
Set the lang option to the language you would like to use.
What languages are available is determined by what localization files are available in the API.
A list of available translations can be found below. If any further languages are required or certain errors where found in the language-documents, please contact the Digital Services Support Team (firstname.lastname@example.org).
By saving the returned object in variable, you can use the api to control the ambilight-player later on in your code
In this case we can use the
al_player variable later on to call the methods below:
||Will trigger the video to play
||Will trigger the video to pause.