From f7eddd92e7d43eac7a4cf9ff0927a551b7ef6e0a Mon Sep 17 00:00:00 2001 From: roadiz-ci Date: Fri, 19 Apr 2024 09:48:26 +0000 Subject: [PATCH] Merge tag v2.2.15 into develop --- src/MediaFinders/AbstractDailymotionEmbedFinder.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MediaFinders/AbstractDailymotionEmbedFinder.php b/src/MediaFinders/AbstractDailymotionEmbedFinder.php index 28ca0ef..7eeb90c 100644 --- a/src/MediaFinders/AbstractDailymotionEmbedFinder.php +++ b/src/MediaFinders/AbstractDailymotionEmbedFinder.php @@ -57,14 +57,14 @@ public function getMediaTitle(): string */ public function getMediaDescription(): string { - return ""; + return $this->getFeed()['description'] ?? ''; } /** * {@inheritdoc} */ public function getMediaCopyright(): string { - return ""; + return $this->getFeed()['author_name'] ?? ''; } /** * {@inheritdoc} @@ -79,6 +79,7 @@ public function getThumbnailURL(): string */ public function getFeed() { + $oEmbedIframePattern = '#src\=\"https\:\/\/(?:www\.|geo\.)?dailymotion\.com\/(?:embed\/video\/|player\.html\?video\=)(?[a-zA-Z0-9\_\-]+)#'; $feed = parent::getFeed(); /* * We need to extract REAL embedId from oEmbed response, from the HTML field. @@ -87,7 +88,7 @@ public function getFeed() if ( is_array($feed) && !empty($feed['html']) - && preg_match('#src\=\"https\:\/\/www\.dailymotion\.com\/embed\/video\/(?[a-zA-Z0-9\_\-]+)#', $feed['html'], $matches) + && preg_match($oEmbedIframePattern, $feed['html'], $matches) ) { $this->embedId = urldecode($matches['realId']); } @@ -162,7 +163,8 @@ public function getSource(array &$options = []): string $queryString['loop'] = (int) $options['loop']; $queryString['controls'] = (int) $options['controls']; $queryString['muted'] = (int) $options['muted']; + $queryString['video'] = $this->embedId; - return 'https://www.dailymotion.com/embed/video/' . $this->embedId . '?' . http_build_query($queryString); + return 'https://geo.dailymotion.com/player.html?' . http_build_query($queryString); } }