Skip to content

Commit

Permalink
fix(player): only fullscreen video view by default on mobile
Browse files Browse the repository at this point in the history
closes #1026
  • Loading branch information
mihar-22 committed Dec 1, 2023
1 parent fff8c36 commit b58616a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vidstack/src/core/state/media-state-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ export class MediaStateManager extends MediaPlayerController {
}

['play'](event: ME.MediaPlayEvent) {
const { paused, autoplayError, ended, autoplaying, playsinline, pointer, muted } = this.$state;
const { paused, autoplayError, ended, autoplaying, playsinline, pointer, muted, viewType } =
this.$state;

event.autoplay = autoplaying();

Expand Down Expand Up @@ -423,7 +424,7 @@ export class MediaStateManager extends MediaPlayerController {
this._handle(this.createEvent('replay', { trigger: event }));
}

if (!playsinline() && pointer() === 'coarse') {
if (!playsinline() && viewType() === 'video' && pointer() === 'coarse') {
this._media.remote.enterFullscreen('prefer-media', event);
}
}
Expand Down

0 comments on commit b58616a

Please sign in to comment.