Home Reference Source
import PictureInPictureToggle from 'videojs-record/js/controls/picture-in-picture-toggle.js'
public class | source

PictureInPictureToggle

Extends:

Button → PictureInPictureToggle

Button to toggle Picture-in-Picture mode.

Constructor Summary

Private Constructor
private

constructor(player: videojs.Player | Object, options: Object)

The constructor function for the class.

Method Summary

Public Methods
public

Builds the default DOM className.

public

async handleClick(event: EventTarget~Event)

This gets called when the button is clicked.

public

onStart(event: EventTarget~Event)

Add the vjs-icon-picture-in-picture-stop class to the element so it can change appearance.

public

onStop(event: EventTarget~Event)

Add the vjs-icon-picture-in-picture-start class to the element so it can change appearance.

public

show()

Show the PictureInPictureToggle element if it is hidden by removing the 'vjs-hidden' class name from it.

Private Constructors

private constructor(player: videojs.Player | Object, options: Object) source

The constructor function for the class.

Params:

NameTypeAttributeDescription
player videojs.Player | Object

Video.js player instance.

options Object

Player options.

Public Methods

public buildCSSClass(): string source

Builds the default DOM className.

Return:

string

The DOM className for this object.

public async handleClick(event: EventTarget~Event) source

This gets called when the button is clicked.

Params:

NameTypeAttributeDescription
event EventTarget~Event

The tap or click event that caused this function to be called.

Listen:

*

tap

*

click

public onStart(event: EventTarget~Event) source

Add the vjs-icon-picture-in-picture-stop class to the element so it can change appearance.

Params:

NameTypeAttributeDescription
event EventTarget~Event
  • optional

The event that caused this function to run.

Listen:

*

Player#enterPIP

public onStop(event: EventTarget~Event) source

Add the vjs-icon-picture-in-picture-start class to the element so it can change appearance.

Params:

NameTypeAttributeDescription
event EventTarget~Event
  • optional

The event that caused this function to run.

Listen:

*

Player#leavePIP

public show() source

Show the PictureInPictureToggle element if it is hidden by removing the 'vjs-hidden' class name from it.