Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PictureInPictureToggle is greyed out in browsers that do not support the Picture-in-Picture API #7898

Closed
amtins opened this issue Aug 28, 2022 · 1 comment · Fixed by #7899
Labels
bug needs: triage This issue needs to be reviewed

Comments

@amtins
Copy link
Contributor

amtins commented Aug 28, 2022

Description

The PictureInPictureToggle component should not be displayed when changing the order of components in the ControlBar in browsers that do not support the Picture-in-Picture API.

Prior to v7.19.0, it was possible to change this behavior by doing the following

class PictureInPictureToggle extends (videojs.getComponent('PictureInPictureToggle')) {
    enable() {
        super.enable();
        this.show();
    }

    disable() {
        super.disable();
        this.hide();
    }
}
videojs.registerComponent('PictureInPictureToggle', PictureInPictureToggle);

Although this solution was not ideal if the requestPictureInPicture failed.

Reduced test case

No response

Steps to reproduce

const video = document.createElement('video');
video.id = 'video';
video.classList.add('video-js');
document.body.append(video);
const p1 = videojs(video, {
    muted: true,
    controls: true,
    controlBar: {
        children: [
            'playToggle',
            'volumePanel',
            'pictureInPictureToggle',
            'currentTimeDisplay',
            'timeDivider',
            'durationDisplay',
            'progressControl',
            'liveDisplay',
            'seekToLive',
            'remainingTimeDisplay',
            'customControlSpacer',
            'playbackRateMenuButton',
            'chaptersButton',
            'descriptionsButton',
            'subsCapsButton',
            'audioTrackButton',
            'fullscreenToggle'
        ]
    }
}, () => {
    p1.src('https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8')
});

Errors

No response

What version of Video.js are you using?

7.20.2

Video.js plugins used.

No response

What browser(s) including version(s) does this occur with?

Firefox

What OS(es) and version(s) does this occur with?

All

@amtins amtins added bug needs: triage This issue needs to be reviewed labels Aug 28, 2022
@video-archivist-bot
Copy link

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug needs: triage This issue needs to be reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants