Skip to content

Commit

Permalink
Do not show PIP button if not allowed
Browse files Browse the repository at this point in the history
There was a bug here that allowed the PIP button to be shown on any
track change event.  This bug only manifests on platforms without PIP,
such as Safari 12.

Found while working on #997 and #382

Change-Id: Iad51b2e9a5e86767a3ebf606c3e3b976d2d19ad7
  • Loading branch information
joeyparrish committed Apr 26, 2019
1 parent 4082eb1 commit 5f72a1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/pip_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ shaka.ui.PipButton = class extends shaka.ui.Element {
* @private
*/
async onTracksChanged_() {
if (this.player && this.player.isAudioOnly()) {
if (!this.isPipAllowed_()) {
shaka.ui.Utils.setDisplay(this.pipButton_, false);
} else if (this.player && this.player.isAudioOnly()) {
shaka.ui.Utils.setDisplay(this.pipButton_, false);
if (document.pictureInPictureElement) {
await document.exitPictureInPicture();
Expand Down

0 comments on commit 5f72a1b

Please sign in to comment.