Video.js: Can't disable Picture In Picture

Created on 12 Aug 2020  路  4Comments  路  Source: videojs/video.js

Description

The title says it all. I'm trying for a few hours now without success.
Here is a sandbox: https://codesandbox.io/s/loving-thompson-z3u3d?file=/index.html

Steps to reproduce

  1. Open the sandbox
  2. look for the different methods i tried
  3. ???
  4. Profit!!!

Results

Expected

The Picture In Picture toggle should be gone

Actual

It is still in the control panel

Error output

If I try to get it done with the documented method video.disablePictureInPicture(true)
I get (index):44 Uncaught TypeError: video.disablePictureInPicture is not a function

Most helpful comment

If you want to hide the picture in picture button, set up the pictureInPictureToggle to false.

      var player = videojs('vjs-player', {
          preload: true,
          autoplay: true,
          controls: true,
          controlBar: {
              'liveDisplay': true,
              'pictureInPictureToggle': false
          }
      });

All 4 comments

馃憢 Thanks for opening your first issue here! 馃憢

If you're reporting a 馃悶 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

The issue is that you're initializing using both data-setup and programmatically. You need to make sure to only use one initialization method. Here's a working sample: https://codesandbox.io/s/quizzical-proskuriakova-yddry?file=/index.html

Also, the method isn't available in Video.js 7.8, it was added in Video.js 7.9 (which we should probably promote to latest)

If you want to hide the picture in picture button, set up the pictureInPictureToggle to false.

      var player = videojs('vjs-player', {
          preload: true,
          autoplay: true,
          controls: true,
          controlBar: {
              'liveDisplay': true,
              'pictureInPictureToggle': false
          }
      });

Thanks for the quick response.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onigetoc picture onigetoc  路  4Comments

cshah123 picture cshah123  路  4Comments

kocoten1992 picture kocoten1992  路  4Comments

SolmazKh picture SolmazKh  路  4Comments

aagiulian picture aagiulian  路  3Comments