|
@@ -1,5 +1,4 @@
|
|
import { h, Component } from 'preact';
|
|
import { h, Component } from 'preact';
|
|
-import { useEffect, useRef } from 'preact/hooks';
|
|
|
|
import videojs from 'video.js';
|
|
import videojs from 'video.js';
|
|
import 'videojs-playlist';
|
|
import 'videojs-playlist';
|
|
import 'video.js/dist/video-js.css';
|
|
import 'video.js/dist/video-js.css';
|
|
@@ -9,27 +8,6 @@ const defaultOptions = {
|
|
fluid: true,
|
|
fluid: true,
|
|
};
|
|
};
|
|
|
|
|
|
-// export default function VideoPlayer({ children, options, onReady = () => {} }) {
|
|
|
|
-// const playerRef = useRef(null);
|
|
|
|
-// useEffect(() => {
|
|
|
|
-// if (playerRef.current) {
|
|
|
|
-// const player = videojs(playerRef.current, { ...defaultOptions, ...options }, () => {
|
|
|
|
-// onReady(player);
|
|
|
|
-// });
|
|
|
|
-// return () => {
|
|
|
|
-// player.dispose();
|
|
|
|
-// };
|
|
|
|
-// }
|
|
|
|
-// }, [options, onReady]);
|
|
|
|
-
|
|
|
|
-// return (
|
|
|
|
-// <div data-vjs-player>
|
|
|
|
-// <video ref={playerRef} className="video-js vjs-default-skin" controls playsInline />
|
|
|
|
-// {children}
|
|
|
|
-// </div>
|
|
|
|
-// );
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
export default class VideoPlayer extends Component {
|
|
export default class VideoPlayer extends Component {
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
const { options, onReady = () => {} } = this.props;
|
|
const { options, onReady = () => {} } = this.props;
|