...
Instantiate the placement object with the placementConfig configuration
...
start()
Start/resume the player placement instance. Should be called only once
...
, including ad flow.
stop()
Pause the currently playing video
resume()
Resume the player if it’s paused
...
Stop the placement, including ad flow.
close() / destroy()
Close the player placement and stop its functionality
resize(width, height)
Resize the player to the requested width and height
completely.
getWidth()
Returns the player width in pixels
...
Register an event listener for player placement events
...
hasNext(
...
Unregister an event/function
startViewability(elid, callback, ratio)
Start viewability monitoring in the player
Parameters:
elid: The element to measure, by default will use the player position
callback: Callback function to call on every viewability change. Callback function parameters:
Boolean: in view or not
Number: Current ratio of viewability
String: State that indicates if below/above/partial the fold
Viewability ratio defined as viewable. Default is 0.5
stopViewability()
Stop viewability monitoring
getViewability()
Returns current viewability of the player
getReadyAds()
...
)
Returns whether we have a ready ad to render for this placement.
show()
Shows the placement, resuming it and the ad flow (no re-construction).
hide()
Hides the placement, stopping it and the ad flow (no destruction).
startInRead()
Applies in-read appearance to the placement.
startInFloat(FloatingConfig
)
Applies floating appearance to the placement, as specific in FloatingConfig:
startInSticky(StickyConfig
)
Applies floating appearance to the placement, as specific in StickyConfig:
resetAppearance(StickyConfig
)
Applies appearance to the placement, as specified in the original placementConfig
.
Player Events
The player on() function can be used to subscribe to events. Multiple listeners can be set for each event
...