diff --git a/app/src/components/VideoPlayer.js b/app/src/components/VideoPlayer.js
index a34e553e..d77be3c9 100644
--- a/app/src/components/VideoPlayer.js
+++ b/app/src/components/VideoPlayer.js
@@ -1,7 +1,8 @@
import React, {useContext, useState} from 'react';
import {deleteVideos} from "../api";
import {Link, useNavigate, useParams} from "react-router-dom";
-import {humanFileSize, humanNumber, PageContainer, secondsToTimestamp, uploadDate, useTitle} from "./Common";
+import _ from "lodash";
+import {API_URI, humanFileSize, humanNumber, PageContainer, secondsToTimestamp, uploadDate, useTitle} from "./Common";
import {Confirm} from "semantic-ui-react";
import Grid from "semantic-ui-react/dist/commonjs/collections/Grid";
import Container from "semantic-ui-react/dist/commonjs/elements/Container";
@@ -18,6 +19,7 @@ function VideoPage({videoFile, prevFile, nextFile, setFavorite, ...props}) {
const {theme} = useContext(ThemeContext);
const navigate = useNavigate();
+ const videoRef = React.useRef();
let [deleteOpen, setDeleteOpen] = useState(false);
useTitle(videoFile === null || videoFile === undefined ? null : videoFile.video.title);
@@ -26,6 +28,11 @@ function VideoPage({videoFile, prevFile, nextFile, setFavorite, ...props}) {
video = videoFile.video;
}
+ // Seeks to the `seconds` on video player.
+ const setVideoTime = (seconds) => {
+ videoRef.current.currentTime = seconds;
+ }
+
// Get the Video's channel, fallback to the URL's channel id.
const {channelId} = useParams();
const {channel} = useChannel(video && video.channel_id ? video.channel_id : channelId);
@@ -67,20 +74,19 @@ function VideoPage({videoFile, prevFile, nextFile, setFavorite, ...props}) {
setFavorite(!favorite);
}
}
- const favorite_button = (
- );
+ const favorite_button = ();
let descriptionPane = {
menuItem: 'Description', render: () =>
- {description || 'No description'}
+ {description ? chaptersInDescription(description, setVideoTime) : 'No description'}