@@ -4,7 +4,6 @@ import { AudioAtomWrapper } from '../components/AudioAtomWrapper.importable';
44import { BlockquoteBlockComponent } from '../components/BlockquoteBlockComponent' ;
55import { CalloutBlockComponent } from '../components/CalloutBlockComponent.importable' ;
66import { CalloutEmbedBlockComponent } from '../components/CalloutEmbedBlockComponent.importable' ;
7- import { Caption } from '../components/Caption' ;
87import { CaptionBlockComponent } from '../components/CaptionBlockComponent' ;
98import { CartoonComponent } from '../components/CartoonComponent' ;
109import { ChartAtom } from '../components/ChartAtom.importable' ;
@@ -30,7 +29,7 @@ import { Island } from '../components/Island';
3029import { ItemLinkBlockElement } from '../components/ItemLinkBlockElement' ;
3130import { KeyTakeaways } from '../components/KeyTakeaways' ;
3231import { KnowledgeQuizAtom } from '../components/KnowledgeQuizAtom.importable' ;
33- import { LoopVideo } from '../components/LoopVideo .importable' ;
32+ import { LoopVideoInArticle } from '../components/LoopVideoInArticle .importable' ;
3433import { MainMediaEmbedBlockComponent } from '../components/MainMediaEmbedBlockComponent' ;
3534import { MapEmbedBlockComponent } from '../components/MapEmbedBlockComponent.importable' ;
3635import { MiniProfiles } from '../components/MiniProfiles' ;
@@ -75,7 +74,6 @@ import type { FEElement, RoleType, StarRating } from '../types/content';
7574import { ArticleDesign , type ArticleFormat } from './articleFormat' ;
7675import type { EditionId } from './edition' ;
7776import { getLargestImageSize } from './image' ;
78- import { convertAssetsToVideoSources , getSubtitleAsset } from './video' ;
7977
8078type Props = {
8179 format : ArticleFormat ;
@@ -508,46 +506,18 @@ export const renderElement = ({
508506 - But they will still be Media Atoms
509507 */
510508 if ( element . videoPlayerFormat === 'Loop' ) {
511- const posterImageUrl = element . posterImage ?. [ 0 ] ?. url ;
512509 return (
513510 < >
514- { ! ! posterImageUrl && (
515- < Island
516- priority = "critical"
517- defer = { { until : 'visible' } }
518- >
519- < >
520- < LoopVideo
521- atomId = { element . id }
522- fallbackImage = { posterImageUrl }
523- fallbackImageAlt = { element . title }
524- fallbackImageAspectRatio = { '5:4' }
525- fallbackImageLoading = { 'lazy' }
526- fallbackImageSize = { 'small' }
527- height = { 400 }
528- linkTo = { '' }
529- posterImage = { posterImageUrl }
530- sources = { convertAssetsToVideoSources (
531- element . assets ,
532- ) }
533- subtitleSize = { 'small' }
534- subtitleSource = { getSubtitleAsset (
535- element . assets ,
536- ) }
537- uniqueId = { element . id }
538- width = { 500 }
539- />
540- { ! ! element . title && (
541- < Caption
542- captionText = { element . title }
543- format = { format }
544- isMainMedia = { isMainMedia }
545- mediaType = "SelfHostedVideo"
546- />
547- ) }
548- </ >
549- </ Island >
550- ) }
511+ < Island
512+ priority = "critical"
513+ defer = { { until : 'visible' } }
514+ >
515+ < LoopVideoInArticle
516+ element = { element }
517+ format = { format }
518+ isMainMedia = { isMainMedia }
519+ />
520+ </ Island >
551521 </ >
552522 ) ;
553523 } else {
0 commit comments