51 lines
1.1 KiB

import React, { Component } from "react";
import VideoPlayer from "react-video-js-player";
import film from "../../../../assets/Video/film.mp4";
import "./index.scss";
class VideoApp extends Component {
player = {};
state = {
video: {
src: `https://dnvn.ir/api/v1/file/${this.props.fileId}`,
},
};
onPlayerReady(player) {
// console.log("Player is ready: ", player);
this.player = player;
}
onVideoPlay(duration) {
// console.log("Video played at: ", duration);
}
onVideoPause(duration) {
// console.log("Video paused at: ", duration);
}
onVideoTimeUpdate(duration) {
// console.log("Time updated: ", duration);
}
onVideoSeeking(duration) {
// console.log("Video seeking: ", duration);
}
onVideoSeeked(from, to) {
// console.log(`Video seeked from ${from} to ${to}`);
}
onVideoEnd() {
// console.log("Video ended");
}
render() {
return (
// <div style={{ width: "100%", height: "100%" }}>
<video controls={true} src={this.state.video.src} type="video/mp4" />
// </div>
);
}
}
export default VideoApp;