Skip to content

Commit

Permalink
fix(pip): hide PiP button in browsers not support the WICG spec (#6131)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored Jul 26, 2019
1 parent 15ff8f7 commit 3afa7d1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/js/control-bar/control-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file control-bar.js
*/
import Component from '../component.js';
import document from 'global/document';

// Required children
import './play-toggle.js';
Expand Down Expand Up @@ -68,10 +69,17 @@ ControlBar.prototype.options_ = {
'descriptionsButton',
'subsCapsButton',
'audioTrackButton',
'pictureInPictureToggle',
'fullscreenToggle'
]
};

if ('exitPictureInPicture' in document) {
ControlBar.prototype.options_.children.splice(
ControlBar.prototype.options_.children.length - 1,
0,
'pictureInPictureToggle'
);
}

Component.registerComponent('ControlBar', ControlBar);
export default ControlBar;

0 comments on commit 3afa7d1

Please sign in to comment.