From 2292f790a0557f62a417d89bde510d28c5d7a97e Mon Sep 17 00:00:00 2001 From: mayeaux Date: Sat, 15 May 2021 07:59:21 +0200 Subject: [PATCH] force autoplay when timestamped (#6064) --- ui/component/fileRenderInitiator/view.jsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/component/fileRenderInitiator/view.jsx b/ui/component/fileRenderInitiator/view.jsx index 91917982a..6d36569c9 100644 --- a/ui/component/fileRenderInitiator/view.jsx +++ b/ui/component/fileRenderInitiator/view.jsx @@ -46,7 +46,6 @@ export default function FileRenderInitiator(props: Props) { history, location, thumbnail, - autoplay, renderMode, hasCostInfo, costInfo, @@ -54,6 +53,16 @@ export default function FileRenderInitiator(props: Props) { authenticated, videoTheaterMode, } = props; + + // force autoplay if a timestamp is present + let autoplay = props.autoplay; + // get current url + const url = window.location.href; + // check if there is a time parameter, if so force autoplay + if (url.indexOf('t=')) { + autoplay = true; + } + const cost = costInfo && costInfo.cost; const isFree = hasCostInfo && cost === 0; const fileStatus = fileInfo && fileInfo.status;