Skip to content

Commit

Permalink
fix(FEC-9420): PIP button is showed but not working (kaltura#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyBregman authored Nov 7, 2019
1 parent 14dc625 commit d8be9b4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/engines/html5/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,14 @@ export default class Html5 extends FakeEventTarget implements IEngine {
* @return {boolean} if the engine is in picture in picture mode or not
*/
isPictureInPictureSupported(): boolean {
return (
!!document.pictureInPictureEnabled ||
(typeof this._el.webkitSupportsPresentationMode === 'function' && this._el.webkitSupportsPresentationMode('picture-in-picture'))
);
// due to a bug in shaka pip_webkit which sets pictureInPictureEnabled to true in unsupported devices like iphones we will
// first rely on the response of webkitSupportsPresentationMode (if exists) and only if not on the pictureInPictureEnabled property
if (typeof this._el.webkitSupportsPresentationMode === 'function') {
return this._el.webkitSupportsPresentationMode('picture-in-picture');
} else {
// $FlowFixMe
return !!document.pictureInPictureEnabled;
}
}

/**
Expand Down

0 comments on commit d8be9b4

Please sign in to comment.