Skip to content

Commit

Permalink
fix: Fullscreen broken in iOS (videojs#6735)
Browse files Browse the repository at this point in the history
The Fullscreen API is unsupported in iOS, so self.fsApi_.fullscreenerror and self.fsApi_.fullscreenchange are undefined, which was breaking the player after entering fullscreen by removing all bound player events.

Fixes videojs#6707, fixes videojs#6684, fixes videojs#6645.
  • Loading branch information
alex-barstow authored and edirub committed Jun 6, 2023
1 parent 05aa45a commit 2ed46cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2794,8 +2794,8 @@ class Player extends Component {

return new PromiseClass((resolve, reject) => {
function offHandler() {
self.off(self.fsApi_.fullscreenerror, errorHandler);
self.off(self.fsApi_.fullscreenchange, changeHandler);
self.off('fullscreenerror', errorHandler);
self.off('fullscreenchange', changeHandler);
}
function changeHandler() {
offHandler();
Expand Down Expand Up @@ -2872,8 +2872,8 @@ class Player extends Component {

return new PromiseClass((resolve, reject) => {
function offHandler() {
self.off(self.fsApi_.fullscreenerror, errorHandler);
self.off(self.fsApi_.fullscreenchange, changeHandler);
self.off('fullscreenerror', errorHandler);
self.off('fullscreenchange', changeHandler);
}
function changeHandler() {
offHandler();
Expand Down

0 comments on commit 2ed46cf

Please sign in to comment.