- // Prevent to have a photo type without an image
- if ($twitter_card && $twitter_image && !empty($siteinfo['image'])) {
- $siteinfo['type'] = 'photo';
+ if (!empty($siteinfo['player']['stream'])) {
+ // Only add player data to media arrays if there is no duplicate
+ $content_urls = array_merge(array_column($siteinfo['audio'] ?? [], 'content'), array_column($siteinfo['video'] ?? [], 'content'));
+ if (!in_array($siteinfo['player']['stream'], $content_urls)) {
+ $contenttype = self::getContentType($siteinfo['player']['stream']);
+ if (!empty($contenttype[0]) && in_array($contenttype[0], ['audio', 'video'])) {
+ $media = ['content' => $siteinfo['player']['stream']];
+
+ if (!empty($siteinfo['player']['embed'])) {
+ $media['embed'] = $siteinfo['player']['embed'];
+ }
+
+ $siteinfo[$contenttype[0]][] = $media;
+ }
+ }