Skip to main content

External play and pause button and hiding the controlBar

In this example the Play and Pause buttons are outside of the player and the control bar is hidden

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<!-- First we load the SDK -->
<script type='text/javascript' src="//"></script>
<!-- and some styling -->
<link rel="stylesheet" href=""
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src=""
<h1>Example with external buttons</h1>
<!-- then we make a div to put the player into-->
<div id="video-wrapper" style="height: 1050px"></div>
<!-- Then we make a div with our 2 buttons -->
<button class="btn btn-primary" onclick="">Play</button>
<button class="btn btn-primary" onclick="player.pause()">Pause</button>
<script type="text/javascript">
// in out script tag we make the wrapper and declare the player so that we have something we can controll with all te functions
let video_wrapper = document.querySelector("#video-wrapper")
let player = new PrivacyPlayerPro(
video_wrapper, true, true
// And finaly we hide the controlBar of the player, we use the player.ready_callback. when the player is ready the functions between the brackets will be executed
player.ready_callback = function () { player.control_bar.hide() }

Live example#