Skip to content

Commit

Permalink
Merge pull request Stremio#642 from Stremio/feature-player-background…
Browse files Browse the repository at this point in the history
…-loader

Feature: player background splash screen loader
  • Loading branch information
tymmesyde committed May 17, 2024
2 parents 911059b + 90a313a commit 1d6a6cc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/routes/Player/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,15 +611,23 @@ const Player = ({ urlParams, queryParams }) => {
onDoubleClick={onVideoDoubleClick}
/>
{
video.state.buffering ?
<BufferingLoader className={styles['layer']} logo={player?.metaItem?.content?.logo} />
!video.state.loaded ?
<div className={classnames(styles['layer'], styles['background-layer'])}>
<img className={styles['image']} src={player?.metaItem?.content?.background} />
</div>
:
null
}
{
(video.state.buffering || !video.state.loaded) && !error ?
<BufferingLoader className={classnames(styles['layer'], styles['buffering-layer'])} logo={player?.metaItem?.content?.logo} />
:
null
}
{
error !== null ?
<Error
className={styles['layer']}
className={classnames(styles['layer'], styles['error-layer'])}
stream={video.state.stream}
{...error}
/>
Expand Down
13 changes: 13 additions & 0 deletions src/routes/Player/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ html:not(.active-slider-within) {
bottom: 0;
z-index: 0;

&.buffering-layer, &.error-layer {
background: transparent;
}

&.background-layer {
.image {
width: 100vw;
height: 100vh;
object-fit: cover;
opacity: 0.6;
}
}

&.nav-bar-layer {
bottom: initial;
background: transparent;
Expand Down

0 comments on commit 1d6a6cc

Please sign in to comment.