add internal video loading screen component
This commit is contained in:
parent
059673983c
commit
57a7d1db97
3 changed files with 49 additions and 21 deletions
12
ui/js/component/video/internal/loading-screen.jsx
Normal file
12
ui/js/component/video/internal/loading-screen.jsx
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const LoadingScreen = ({ statusMessage }) =>
|
||||||
|
<div className="video--loading--screen">
|
||||||
|
<div className="loading--spinner" />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{statusMessage}
|
||||||
|
</div>
|
||||||
|
</div>;
|
||||||
|
|
||||||
|
export default LoadingScreen;
|
|
@ -4,6 +4,7 @@ import Link from "component/link";
|
||||||
import Modal from "component/modal";
|
import Modal from "component/modal";
|
||||||
import lbry from "lbry";
|
import lbry from "lbry";
|
||||||
import { Thumbnail } from "component/common";
|
import { Thumbnail } from "component/common";
|
||||||
|
import LoadingScreen from "./internal/loading-screen";
|
||||||
|
|
||||||
class VideoPlayButton extends React.Component {
|
class VideoPlayButton extends React.Component {
|
||||||
onPurchaseConfirmed() {
|
onPurchaseConfirmed() {
|
||||||
|
@ -148,31 +149,27 @@ class Video extends React.Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={klassName}>
|
<div className={klassName}>
|
||||||
{isPlaying
|
{isPlaying &&
|
||||||
? !isReadyToPlay
|
(!isReadyToPlay
|
||||||
? <span>
|
? <LoadingScreen status={loadStatusMessage} />
|
||||||
{__(
|
|
||||||
"this is the world's worst loading screen and we shipped our software with it anyway..."
|
|
||||||
)}
|
|
||||||
{" "}<br /><br />{loadStatusMessage}
|
|
||||||
</span>
|
|
||||||
: <VideoPlayer
|
: <VideoPlayer
|
||||||
filename={fileInfo.file_name}
|
filename={fileInfo.file_name}
|
||||||
poster={poster}
|
poster={poster}
|
||||||
downloadPath={fileInfo.download_path}
|
downloadPath={fileInfo.download_path}
|
||||||
mediaType={mediaType}
|
mediaType={mediaType}
|
||||||
poster={poster}
|
poster={poster}
|
||||||
/>
|
/>)}
|
||||||
: <div
|
{!isPlaying &&
|
||||||
className="video__cover"
|
<div
|
||||||
style={{ backgroundImage: 'url("' + metadata.thumbnail + '")' }}
|
className="video__cover"
|
||||||
>
|
style={{ backgroundImage: 'url("' + metadata.thumbnail + '")' }}
|
||||||
<VideoPlayButton
|
>
|
||||||
startPlaying={this.startPlaying.bind(this)}
|
<VideoPlayButton
|
||||||
{...this.props}
|
startPlaying={this.startPlaying.bind(this)}
|
||||||
mediaType={mediaType}
|
{...this.props}
|
||||||
/>
|
mediaType={mediaType}
|
||||||
</div>}
|
/>
|
||||||
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ video {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.video-embedded {
|
.video-embedded {
|
||||||
max-width: $width-page-constrained;
|
max-width: $width-page-constrained;
|
||||||
max-height: $height-video-embedded;
|
max-height: $height-video-embedded;
|
||||||
|
@ -28,6 +27,26 @@ video {
|
||||||
&.video--active {
|
&.video--active {
|
||||||
/*background: none;*/
|
/*background: none;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.video--loading--screen {
|
||||||
|
.loading--spinner {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
background-color: white;
|
||||||
|
margin: auto;
|
||||||
|
|
||||||
|
animation-name: spin;
|
||||||
|
animation-duration: 1s;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
from { transform: rotate(0deg) }
|
||||||
|
to { transform: rotate(-360deg) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.plyr {
|
.plyr {
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
|
@ -61,4 +80,4 @@ video {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: opacity $transition-standard;
|
transition: opacity $transition-standard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue