Merge pull request #280 from lbryio/player-classes

Use array to build classes in video view
This commit is contained in:
Jeremy Kauffman 2017-06-24 14:53:24 -04:00 committed by GitHub
commit ee1de52156

View file

@ -46,20 +46,20 @@ class Video extends React.PureComponent {
loadStatusMessage = __("Downloading stream... not long left now!");
}
let klassName = "";
if (isLoading || isDownloading) klassName += "video-embedded video";
let klasses = [];
if (isLoading || isDownloading) klasses.push("video-embedded", "video");
if (mediaType === "video") {
klassName += "video-embedded video";
klassName += isPlaying ? " video--active" : " video--hidden";
klasses.push("video-embedded", "video");
klasses.push(isPlaying ? "video--active" : "video--hidden");
} else if (mediaType === "application") {
klassName += "video-embedded";
klasses.push("video-embedded");
} else {
if (!isPlaying) klassName += "video-embedded";
if (!isPlaying) klasses.push("video-embedded");
}
const poster = metadata.thumbnail;
return (
<div className={klassName}>
<div className={klasses.join(" ")}>
{isPlaying &&
(!isReadyToPlay
? <LoadingScreen status={loadStatusMessage} />