import React from "react";
import "./Player.css"
import {PlyrComponent} from 'plyr-react';
import SideBar from "../../elements/SideBar/SideBar";
import Tag from "../../elements/Tag/Tag";
import AddTagPopup from "../../elements/AddTagPopup/AddTagPopup";
import PageTitle from "../../elements/PageTitle/PageTitle";
class Player extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
sources: null,
movie_id: null,
movie_name: null,
likes: null,
quality: null,
length: null,
tags: [],
popupvisible: false
};
this.props = props;
}
options = {
controls: [
'play-large', // The large play button in the center
'play', // Play/pause playback
'progress', // The progress bar and scrubber for playback and buffering
'current-time', // The current time of playback
'duration', // The full duration of the media
'mute', // Toggle mute
'volume', // Volume control
'captions', // Toggle captions
'settings', // Settings menu
'airplay', // Airplay (currently Safari only)
'download', // Show a download button with a link to either the current source or a custom URL you specify in your options
'fullscreen', // Toggle fullscreen
]
};
componentDidMount() {
this.fetchMovieData();
}
render() {
return (
Infos:
{this.state.likes} Likes!
{this.state.quality !== 0 ?
{this.state.quality}p Quality!
: null}
{this.state.length !== 0 ?
{Math.round(this.state.length / 60)} Minutes of length!
: null}
Tags:
{this.state.tags.map((m) => (
{m.tag_name}
))}
{/* video component is added here */}
{this.state.sources ? :