force autoplay when timestamped (#6064)

This commit is contained in:
mayeaux 2021-05-15 07:59:21 +02:00 committed by GitHub
parent 3131b48c77
commit 2292f790a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;