headless mode if you want to build your own user-interface on top of it.
If the player is initialized without a target, the UI will be disabled and it will be mounted at the end of the <body> tag.
Alternatively, you can set showUserInterface: false when initializing the player to disable the UI:
<video> tag).
If playerStyle: "video", showUserInterface: false is set then the <video> tag will show without any controls.
Overview
The simplest way to build your own UI is to repeatedly query the player instance and re-render. For example, you can getplayer.playbackState and player.currentTime then update your UI accordingly.
More complex features like progress bars can be built using this technique.
The simplest way to repeatedly query the player is by registering an event listener for all events:
currentTime being updated.
See Listening to Events and Player Events for more information.
Using React
If you’re using React, here’s how you might implement the above technique in a component:Cleaning up
The return value ofaddEventListener is a string that is a handle to the listener.
This allows you remove the listener, for example, if a React component is unmounted: