Iframe API Reference
Methods#
PLAY#
Plays or resumes the video.
PAUSE#
Pauses the video.
SEEK#
Seeks the video to the value of data in seconds. data must be an int or float.
GO_TO_TAG#
Seeks the video to the starting time of the tag. data is the spriteId of the tag.
OPEN_TAG#
Seeks the video to the starting time of the tag and opens the overlay associated with that tag. data is the spriteId of the tag.
CLOSE_WIDGET#
Closes widget/overlay.
Getters#
GET_CURRENT_TIME#
Triggers the return current time event.
IS_PLAYER_READY#
Triggers the player ready event if the player is ready.
Setters#
MUTE_VOLUME#
Mute volume.
UNMUTE_VOLUME#
Unmute volume.
CHANGE_VOLUME#
Changes the volume. The data is a float between 0 and 1.
Note: CHANGE_VOLUME is not supported on iOS, as iOS does not allow to set volume programmatically. We recommend to use MUTE_VOLUME and UNMUTE_VOLUME instead.
DEVICE_MOTION#
note
This event is for customization only in Player 4. Player 5 no longer support this event.
Inform the player of the device motion. The device motion can be retrieved from the window event “devicemotion”. The data must have the following properties:
DEVICE_ORIENTATION#
note
This event is for customization only in Player 4. Player 5 no longer support this event.
Inform the player of the device orientation. The device orientation can be retrieved from the window event “deviceorientation”.
The data must have the following properties:
DEVICE_SCREEN_ORIENTATION#
note
This event is for customization only in Player 4. Player 5 no longer support this event.
Inform the player of the device screen orientation. The device screen orientation can be retrieved from the window event “orientationchange” .
The data must be one of the following values: -90, 0, 90, 180.
CLIENT_CUSTOM_TRIGGER#
note
This event is for customization only in Player 4. Player 5 no longer support this event.
Event Listeners#
PLAYER_READY#
Triggered when the player is ready.
VIDEO_END#
Triggered when the video has ended.
HAS_PAUSED#
Triggered when the video is paused.
HAS_PLAYED#
Triggered when the video is played.
HAS_SEEKED#
Triggered when the user seeks in the video. Passes information about the seeked to time to the callback.
STARTED_BUFFERING#
note
Player 5 no longer support this event.
Triggered when the player starts buffering.
ENDED_BUFFERING#
note
Player 5 no longer support this event.
Triggered the player has finished buffering.
TAG_CLICK#
Triggered when a tag is clicked. Passes the tag object which has been clicked through to the callback.
ADD_TO_CART#
Triggered when an addToCart link is clicked (only for customisations where this has been implemented). Passes information about the added product to the callback.
RETURN_CURRENT_TIME#
Triggered when the getCurrentTime event is triggered. Passes information about the current time to the callback.
Note: Requesting the current time more than once per second might lead to player slowdown.
WIDGET_SHOWN#
Triggered when the widget/overlay is open.
Note: Only Player 5 will return hotspot meta data.
WIDGET_CLOSED#
Triggered when the widget/overlay is closed.
Note: Only Player 5 will return hotspot meta data.
VOLUME_CHANGE#
CLIENT_CUSTOM_EVENT#
note
Player 5 no longer support this event.
Triggered when the volume is changed.
OVERLAY_EVENT#
note
This event is only available in Player 5.
Triggered when "Add to cart" or "Clickthrough" buttons inside overlay are clicked.
Breaking Changes#
- Player 4 doesn't support
OVERLAY_EVENTlistener. - Player 5 no longer support trigger event
DEVICE_MOTION,DEVICE_ORIENTATION,DEVICE_SCREEN_ORIENTATION,CLIENT_CUSTOM_TRIGGER, customization features are implemented within Studio now. - Player 5 no longer support listener event
STARTED_BUFFERING,ENDED_BUFFERING,CLIENT_CUSTOM_EVENT, because of tech stacks upgrade. - Player 5 no longer support
enableGyro().