Skip to content

Commit

Permalink
fix(player): aspect ratio breaks on safari
Browse files Browse the repository at this point in the history
closes #936
  • Loading branch information
mihar-22 committed Oct 2, 2023
1 parent 9948109 commit 611a418
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 0 additions & 2 deletions packages/react/.templates/sandbox/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ media-player {
--video-border-radius: 2px;

/* 👉 https://vidstack.io/docs/player/components/layouts/default#css-variables for more. */

width: 100%;
}

media-player[data-view-type='video'] {
Expand Down
2 changes: 0 additions & 2 deletions packages/vidstack/.templates/sandbox/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ media-player {
--video-border-radius: 2px;

/* 👉 https://vidstack.io/docs/player/components/layouts/default#css-variables for more. */

width: 100%;
}

media-player[data-view-type='video'] {
Expand Down
6 changes: 3 additions & 3 deletions packages/vidstack/player/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

:where([data-media-player]) {
width: 100%;
min-width: 275px;
display: inline-block;
display: inline-flex;
align-items: center;
position: relative;
contain: style;
box-sizing: border-box;
Expand Down Expand Up @@ -62,7 +62,7 @@
display: inline-block;
width: 100%;
height: auto;
object-fit: cover;
object-fit: contain;
touch-action: manipulation;
}

Expand Down
6 changes: 4 additions & 2 deletions packages/vidstack/player/styles/default/poster.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
opacity: 0;
width: 100%;
height: 100%;
z-index: 1;
border: 0;
pointer-events: none;
object-fit: cover;
box-sizing: border-box;
transition: opacity 0.2s ease-out;
}
Expand All @@ -29,9 +30,10 @@
}

.vds-poster :where(img) {
border: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-fit: contain;
}

:where(.vds-poster[data-hidden]) {
Expand Down
4 changes: 3 additions & 1 deletion packages/vidstack/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const MAIN_EXTERNAL = ['hls.js', 'media-captions', 'media-icons'],
// Styles
if (!MODE_TYPES || MODE_WATCH) {
if (MODE_WATCH) {
chokidar.watch('player/styles/**').on('all', buildDefaultTheme);
chokidar.watch('player/styles/**').on('all', (_, path) => {
if (path !== 'player/styles/default/theme.css') buildDefaultTheme();
});
} else {
buildDefaultTheme();
}
Expand Down
3 changes: 1 addition & 2 deletions packages/vidstack/src/core/api/player-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ export interface MediaPlayerProps
controlsDelay: number;
/**
* This method will indicate the orientation to lock the screen to when in fullscreen mode and
* the Screen Orientation API is available. The default is `undefined` which indicates
* no screen orientation change.
* the Screen Orientation API is available.
*/
fullscreenOrientation: ScreenOrientationLockType | undefined;
/**
Expand Down

0 comments on commit 611a418

Please sign in to comment.