Skip to content

Commit

Permalink
[TASK] added condition to youtube dataprocessor
Browse files Browse the repository at this point in the history
- to check, if reference file is a youtube file. this is needed when using the processor in another element. eg. textmedia
  • Loading branch information
Volker Kemeter committed Jan 23, 2024
1 parent 7b5ad2d commit f9e1c81
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Classes/DataProcessing/YoutubeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$referencesField = $processorConfiguration['referencesField'] ?? 'files';

foreach ($processedData[$referencesField] ?? [] as $reference) {
$videoId = $reference->getContents();
$video = $this->getVideo($videoId, $reference);
if ($reference->getMimeType() === 'video/youtube') {
$videoId = $reference->getContents();
$video = $this->getVideo($videoId, $reference);

if ($video) {
$videos[] = $video;
if ($video) {
$videos[] = $video;
}
}
}

Expand Down

0 comments on commit f9e1c81

Please sign in to comment.