Skip to content

External Control

ParOne exposes functions to allow external control of the player. These functions can be accessed by obtaining a reference to the ParOne element.

FunctionNotes
player.play()Begin content playback
player.pause()Pause content playback

// Control a player with javascript
const player = document.querySelector('parone-video-block')

Controlling multiple players on the page

If there are multiple players on a page, you can give each one an ID and then access it via document.querySelector('#playerOne').

<!-- Give ID of playerOne -->
<parone-video-block id='playerOne'></parone-video-block>
// Target playerOne
document.querySelector('#playerOne')