Skip to content

Commit

Permalink
Layouts: Fix Canvas only layouts should set their duration from any i…
Browse files Browse the repository at this point in the history
…mages added or a 10 second minimum
  • Loading branch information
mgbaybay committed Oct 2, 2024
1 parent fdff166 commit aa724b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Entity/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,11 @@ public function toXlf()
// Pull out the global widget, if we have one (we should)
if ($item->type === 'global') {
$widget = $item;

// For canvas-only region without custom duration, use the media duration or default to 10
if (count($allRegions) === 1 && $widget->useDuration !== 1) {
$widgetDuration = $widget->getDurationForMedia() ?? 10;
}
}

// Get the highest duration.
Expand Down

0 comments on commit aa724b7

Please sign in to comment.