Presentation API

The Presentation object, available under player.presentation is used to check the current presentation mode, check if a mode is supported on the current platform and change the mode. It replaces the deprecated player.presentationMode.

Properties

The Presentation object provides the following properties:

Property Type Description
currentMode string

Gets the currently active presentation mode of the player. Default is `'inline'.

Available presentation modes 

  • 'inline'`: the player is shown in its original location on the page
  • 'fullscreen'`: the player fills the entire screen
  • 'picture-in-picture'`: the player is shown in a corner above the page. See PiPConfiguration for more options

 

Methods

The Presentation object provides the following methods:

Property Arguments Returns Description
requestMode string   Change the current presentation mode of the player
  string boolean Returns whether the player supports showing in the given presentation mode.
addEventListener type : string, listener : EventListener    Adds an eventListener
 removeEventListener  type : string, listener : EventListener   Removes an eventListener 

Events

The Presentation object dispatches the following events:

Property Description
presentationmodechange Dispatched to indicate that the presentationMode has changes
error

Dispatched to indicate that there was an error changing the presentationMode. The error is an object consisting of:

  • error: the error message