Skip to content

Commit

Permalink
fix(fs): don't set player element css props on native fullscreen (#6673)
Browse files Browse the repository at this point in the history
Fixes #6640
  • Loading branch information
gkatsev authored May 28, 2020
1 parent 756fbfc commit d6b07f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/css/components/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ body.vjs-full-window {
bottom: 0;
right: 0;
}
.video-js.vjs-fullscreen {
.video-js.vjs-fullscreen:not(.vjs-ios-native-fs) {
width: 100% !important;
height: 100% !important;
// Undo any aspect ratio padding for fluid layouts
padding-top: 0 !important;
}

.video-js.vjs-fullscreen.vjs-user-inactive {
cursor: none;
}
Expand Down
3 changes: 3 additions & 0 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,9 @@ class Player extends Component {
*/
handleTechFullscreenChange_(event, data) {
if (data) {
if (data.nativeIOSFullscreen) {
this.toggleClass('vjs-ios-native-fs');
}
this.isFullscreen(data.isFullscreen);
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,11 @@ class Html5 extends Tech {
this.el_.webkitPresentationMode !== 'picture-in-picture') {
this.one('webkitendfullscreen', endFn);

this.trigger('fullscreenchange', { isFullscreen: true });
this.trigger('fullscreenchange', {
isFullscreen: true,
// set a flag in case another tech triggers fullscreenchange
nativeIOSFullscreen: true
});
}
};

Expand Down

1 comment on commit d6b07f0

@iamabhyas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gkatsev That update code resolved my issue "iPhone Safari and Chrome: FullScreen portrait video auto-resizing large to small vice-versa."
issue link "#6716"

Please sign in to comment.