diff --git a/src/components/Title.js b/src/components/Title.js
index 6d673ac2..b03f1aa8 100644
--- a/src/components/Title.js
+++ b/src/components/Title.js
@@ -14,6 +14,7 @@ export function Title(props) {
const accentLink = props.accentLink || "";
const accent = props.accent || "";
+
return (
{accent.length > 0 ? (
@@ -26,7 +27,7 @@ export function Title(props) {
{accentLink.length > 0 ? (
) : null}{accent}
) : null}
-
{props.children}
+
{props.children}
)
}
diff --git a/src/components/VideoElement.js b/src/components/VideoElement.js
index 2f3863fc..13426eb0 100644
--- a/src/components/VideoElement.js
+++ b/src/components/VideoElement.js
@@ -6,10 +6,17 @@ import './VideoElement.css'
// streamUrl: string
// loading: boolean
-export function VideoElement({ streamUrl, loading, setProgress }) {
- const videoRef = React.useRef(null);
+// setProgress: (event: NativeEvent) => void
+// videoRef: useRef
+// startTime: number
+export function VideoElement({ streamUrl, loading, setProgress, videoRef, startTime }) {
const [error, setError] = React.useState(false);
+ function onLoad() {
+ if (startTime)
+ videoRef.current.currentTime = startTime;
+ }
+
React.useEffect(() => {
if (!streamUrl.endsWith('.mp4')) {
setError(false)
@@ -28,7 +35,7 @@ export function VideoElement({ streamUrl, loading, setProgress }) {
hls.attachMedia(videoRef.current);
hls.loadSource(streamUrl);
}
- }, [videoRef, streamUrl, loading])
+ }, [videoRef, streamUrl, loading]);
if (error)
return (
Your browser is not supported)
@@ -41,11 +48,11 @@ export function VideoElement({ streamUrl, loading, setProgress }) {
if (!streamUrl.endsWith('.mp4')) {
return (
-
+
)
} else {
return (
-