-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathVideo.tsx
More file actions
29 lines (27 loc) · 758 Bytes
/
Video.tsx
File metadata and controls
29 lines (27 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import * as React from 'react';
import {extend} from 'lodash';
import {fullscreen} from '../styles/index';
const baseStyle = extend({background: 'black'}, fullscreen);
/**
* @return {null}
*/
export default function Video({ video, renderer}) {
if (video && video.path && renderer) {
const width = renderer.canvas.clientWidth;
const height = renderer.canvas.clientHeight;
return <video
style={baseStyle}
autoPlay
width={width}
height={height}
onEnded={video.onEnded}
onError={video.onEnded}
>
<source
type="video/mp4"
src={`data/${video.path}`}
/>
</video>;
}
return null;
}