Documentation

Scale Information

In certain instances, particularly when the player is being styled using the css transform property, it may be necessary to provide it with scaling information. If this is not done, some addons may start behaving incorrectly when the player is scaled – an example issue would be displaying the dragged element in a different place than the cursor.

Updating scale information

The scaling information has to be updated whenever the player is resized (for example, when the value of the transform css applied to the player changes). In addition to that, if initial scaling differs from the default values, that information also has to be passed to the player. In order to do so, you need to use the player.setScaleInformation(scaleInformation) method. The scaleInformation object should contain the fields described in the setScaleInformation section. If no scaling is applied to the player after resizing, the scaleInformation object should contain the default values.

setScaleInformation

This command is called on the player object.

Field Description
scaleX Scaling of the player on the X axis. It is equal to the actual displayed width of the player by its width without scaling. The default value is 1.0 . The value set for this key is equal to the value from the baseScaleX key returned in the `getScaleInformation` command.
scaleY Scaling of the player on the Y axis. It is equal to the actual displayed height of the player by its height without scaling. The default value is 1.0 . The value set for this key is equal to the value from the baseScaleY key returned in the `getScaleInformation` command.
transform Value of transform css style applied to the player. The default value is "".
transformOrigin Value of transform-origin css style applied to the player. The default value is "".

getScaleInformation

This command is called on the player.getPlayerServices() object. Learn more about player services by visiting the Player services section.

Field Description
baseScaleX Scaling of the player on the X axis. It is equal to the actual displayed width of the player by its width without scaling. The default value is 1.0 .
baseScaleY Scaling of the player on the Y axis. It is equal to the actual displayed height of the player by its height without scaling. The default value is 1.0 .
scaleX Scaling of the page (`.ic_page` element) on the X axis. It is equal to the baseScaleX value multiplied by the modifier applied by one of addons. The default value is 1.0.
scaleY Scaling of the page (`.ic_page` element) on the Y axis. It is equal to the baseScaleY value multiplied by the modifier applied by one of addons. The default value is 1.0.
transform Value of transform css style applied to the player. The default value is "".
transformOrigin Value of transform-origin css style applied to the player. The default value is "".