From 69cc53f0608c9001343f6903da7b6fefed8f4b92 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 22 Aug 2024 12:19:18 +0200 Subject: [PATCH] wait #7050 @0:10 --- src/Links/WebVideoLink.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Links/WebVideoLink.php b/src/Links/WebVideoLink.php index 7422867..d8833ae 100644 --- a/src/Links/WebVideoLink.php +++ b/src/Links/WebVideoLink.php @@ -133,12 +133,21 @@ class WebVideoLink extends VideoLink case 'vimeo': $u = parse_url($data->to); $id = $u['path']; - $url = 'https://player.vimeo.com/video/' . $id; - parse_str($u['query'], $params); + + $params = []; + if (isset($u['query'])) { + parse_str($u['query'], $params); + } + $params['autoplay'] = $autoplay; $params['loop'] = $loop; $params['muted'] = $muted; - $url .= '?' . http_build_query($params); + if (stristr($id, '/')) { + $e = explode('/', $id); + $params['h'] = $e[1]; + $id = $e[0]; + } + $url = 'https://player.vimeo.com/video/' . $id . '?' . http_build_query($params); if (isset($u['fragment']) && $u['fragment'] != '') { $url .= '#' . $u['fragment']; } -- 2.39.5