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
<!-- Create a container for the Ambilightplayer --> <div id="ambilightplayer"></div> <!-- Include the Ambilightplayer API hosted on http://acc.ambilightplayer.philips.com --> <script src="http://acc.ambilightplayer.philips.com/content/js/distr/ambilight.api.2.0.0.js"></script> <!-- The script to initiate the creation of the Ambilightplayer --> <script type="text/javascript"> window.onload = function(){ var al_player = new AmbilightPlayer({ id: 'ambilightplayer', //The id of the container domain: 'http://acc.ambilightplayer.philips.com' //The domain of the HTML file you are adding the Ambilight-player to }); } </script>
Both the 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.
Option | Default | Description |
---|---|---|
id |
no default |
Required The id of the DOM-element where the amibilight will be created |
domain |
no default |
Required The domain of where the HTML-file is hosted. We need to know which domain can be trusted for API-calls |
lang |
en-us |
The language the Ambilight-player should use. |
width |
100% |
The width for the Ambilightplayer-iframe. This can be specified as pixels or as a percentage. |
height |
100% |
The height for the Ambilightplayer-iframe. This can be specified as pixels or as a percentage. |
autoplay |
true |
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. |
volume |
1 |
Initial volume for the video (0-1). Use a comma value for values in between 0 and 1 (ex: 0.5 for 50% volume). |
api_ready |
null |
A callback function which is called once the API is ready to be used. This way you can avoid "function is undefined" errors. |
learn_more |
true |
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. |
compare_btn |
true |
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. |
social_btns |
true |
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 (digital.services@philips.com).
Country | Language | Parameter |
---|---|---|
Argentina | Spanish | es-ar |
Austria | German | de-at |
Belgium | French | fr-be |
Belgium | Dutch | nl-be |
Brazil | Portuguese | pt-br |
Bulgaria | Bulgarian | bg-bg |
Croatia | Croatian | hr-hr |
Czech Republic | Cezch | cs-cz |
Denmark | Danish | da-dk |
Estonia | Estonian | et-ee |
Finland | Finnish | fi-fi |
France | French | fr-fr |
Germany | German | de-de |
Greece | Greek | el-gr |
Hungary | Hungarian | hu-hu |
Italy | Italian | it-it |
Latvia | Latvian | lv-lv |
Lithuania | Lithuanian | lt-lt |
Netherlands | Dutch | nl-nl |
Norway | Norwegian | no-no |
Poland | Polish | pl-pl |
Portugal | Portuguese | pt-pt |
Romania | Romanian | ro-ro |
Russia | Russian | ru-ru |
Slovakia | Slovak | sk-sk |
Slovenia | Slovenian | sl-si |
Spain | Spanish | es-es |
Sweden | Swedish | sv-se |
Switzerland | German | de-ch |
Switzerland | French | fr-ch |
Turkey | Turkish | tr-tr |
Ukraine | Russian | ru-ua |
United Kingdom | English | en-gb |
By saving the returned object in variable, you can use the api to control the ambilight-player later on in your code
<script type="text/javascript"> window.onload = function(){ var al_player = new AmbilightPlayer({ id: 'ambilightplayer', domain: 'http://from.norvelljefferson.com/to/Philips/2014/ambilight2_api', width: '100%', height: '100%' }); } </script>
In this case we can use the al_player
variable later on to call the methods below:
Method | Description |
---|---|
.play() |
Will trigger the video to play Example al_player.play() |
.pause() |
Will trigger the video to pause. Example al_player.pause() |