Video: testing fallback image support

This commit is contained in:
2018-06-06 07:56:33 +10:00
parent 0931d428f4
commit 9f0a9d33d5
2 changed files with 10 additions and 1 deletions

View File

@ -24,4 +24,9 @@
object-fit:cover;
}
}
&__image {
position: absolute;
}
}

View File

@ -23,6 +23,7 @@
import React from 'react';
import Loader from './../loading/Loader';
import Image from './../image/Image';
//Adjust the order to adjust the load position
const VALID_SOURCES = [
@ -95,11 +96,14 @@ export default class Video extends React.Component {
//Fallback.
let fallback;
if(sourceProps.image) {
fallback = <Image image={sourceProps.image} alt={sourceProps.alt} className="o-video__image" />
}
//Loader
let loader;
if(this.state.loader) {
loader = <Loader />
loader = <Loader className="o-video__loader" />
}