();
+
+ useEffect(() => {
+ counter ??= 0;
+ setIndex(++counter);
+ }, []);
+
useEffect(() => {
const defineConsentState = async () => {
const { onConsentChange } = await import(
@@ -200,7 +208,7 @@ export const YoutubeBlockComponent = ({
return (
{
assetId="d2Q5bXvEgMg"
mediaTitle="Prince Harry and Meghan's 'bombshell' plans explained – video"
id="c2b8a51c-cb3d-41e7-bb79-1d9a091d0c28"
- elementId="5ab531a2-f6ea-499d-b274-191114c8628c"
expired={false}
stickyVideos={false}
/>
@@ -83,7 +82,6 @@ export const Vertical = () => {
assetId="d2Q5bXvEgMg"
mediaTitle="Prince Harry and Meghan's 'bombshell' plans explained – video"
id="c2b8a51c-cb3d-41e7-bb79-1d9a091d0c28"
- elementId="5ab531a2-f6ea-499d-b274-191114c8628c"
expired={false}
height={259}
width={460}
@@ -118,7 +116,6 @@ export const Expired = () => {
assetId="d2Q5bXvEgMg"
mediaTitle="Prince Harry and Meghan's 'bombshell' plans explained – video"
id="c2b8a51c-cb3d-41e7-bb79-1d9a091d0c28"
- elementId="5ab531a2-f6ea-499d-b274-191114c8628c"
expired={true}
overrideImage="https://i.guim.co.uk/img/media/49565a29c6586fe6b748926e0be96c5e9c90473c/0_0_4981_2989/500.jpg?quality=85&auto=format&fit=max&s=17c70ec70002ea34886fd6c2605cd81e"
height={259}
@@ -154,7 +151,6 @@ export const WithOverlayImage = () => {
assetId="d2Q5bXvEgMg"
mediaTitle="Prince Harry and Meghan's 'bombshell' plans explained – video"
id="c2b8a51c-cb3d-41e7-bb79-1d9a091d0c28"
- elementId="5ab531a2-f6ea-499d-b274-191114c8628c"
expired={false}
duration={333}
overrideImage="https://i.guim.co.uk/img/media/49565a29c6586fe6b748926e0be96c5e9c90473c/0_0_4981_2989/500.jpg?quality=85&auto=format&fit=max&s=17c70ec70002ea34886fd6c2605cd81e"
@@ -191,7 +187,6 @@ export const WithPosterImage = () => {
assetId="d2Q5bXvEgMg"
mediaTitle="Prince Harry and Meghan's 'bombshell' plans explained – video"
id="c2b8a51c-cb3d-41e7-bb79-1d9a091d0c28"
- elementId="5ab531a2-f6ea-499d-b274-191114c8628c"
expired={false}
duration={333}
posterImage={[
@@ -249,7 +244,6 @@ export const WithPosterAndOverlayImage = () => {
assetId="d2Q5bXvEgMg"
mediaTitle="Prince Harry and Meghan's 'bombshell' plans explained – video"
id="c2b8a51c-cb3d-41e7-bb79-1d9a091d0c28"
- elementId="5ab531a2-f6ea-499d-b274-191114c8628c"
expired={false}
overrideImage="https://i.guim.co.uk/img/media/49565a29c6586fe6b748926e0be96c5e9c90473c/0_0_4981_2989/500.jpg?quality=85&auto=format&fit=max&s=17c70ec70002ea34886fd6c2605cd81e"
duration={333}
@@ -308,7 +302,6 @@ export const WithShowMainVideoFlagOff = () => {
assetId="d2Q5bXvEgMg"
mediaTitle="Prince Harry and Meghan's 'bombshell' plans explained – video"
id="c2b8a51c-cb3d-41e7-bb79-1d9a091d0c28"
- elementId="5ab531a2-f6ea-499d-b274-191114c8628c"
expired={false}
overrideImage="https://i.guim.co.uk/img/media/49565a29c6586fe6b748926e0be96c5e9c90473c/0_0_4981_2989/500.jpg?quality=85&auto=format&fit=max&s=17c70ec70002ea34886fd6c2605cd81e"
duration={333}
diff --git a/dotcom-rendering/src/lib/liveblogAdSlots.test.ts b/dotcom-rendering/src/lib/liveblogAdSlots.test.ts
index 28696daa6ac..e86b004753c 100644
--- a/dotcom-rendering/src/lib/liveblogAdSlots.test.ts
+++ b/dotcom-rendering/src/lib/liveblogAdSlots.test.ts
@@ -55,7 +55,6 @@ describe('calculateApproximateBlockHeight', () => {
_type: 'model.dotcomrendering.pageElements.YoutubeBlockElement',
id: '1',
assetId: '',
- elementId: '1',
expired: false,
mediaTitle: '',
},
diff --git a/dotcom-rendering/src/lib/renderElement.tsx b/dotcom-rendering/src/lib/renderElement.tsx
index e9c328d3d59..2b14b99afcc 100644
--- a/dotcom-rendering/src/lib/renderElement.tsx
+++ b/dotcom-rendering/src/lib/renderElement.tsx
@@ -743,7 +743,6 @@ export const renderElement = ({
hideCaption={hideCaption}
isMainMedia={isMainMedia}
id={element.id}
- elementId={element.elementId}
assetId={element.assetId}
expired={element.expired}
overrideImage={element.overrideImage}
diff --git a/dotcom-rendering/src/model/article-schema.json b/dotcom-rendering/src/model/article-schema.json
index 153fac988f5..97bdf738b42 100644
--- a/dotcom-rendering/src/model/article-schema.json
+++ b/dotcom-rendering/src/model/article-schema.json
@@ -3306,9 +3306,6 @@
"type": "string",
"const": "model.dotcomrendering.pageElements.YoutubeBlockElement"
},
- "elementId": {
- "type": "string"
- },
"assetId": {
"type": "string"
},
@@ -3358,7 +3355,6 @@
"required": [
"_type",
"assetId",
- "elementId",
"expired",
"id",
"mediaTitle"
@@ -4398,7 +4394,7 @@
"type": "string",
"const": "Video"
},
- "elementId": {
+ "id": {
"type": "string"
},
"videoId": {
@@ -4443,7 +4439,6 @@
},
"required": [
"duration",
- "elementId",
"expired",
"height",
"images",
diff --git a/dotcom-rendering/src/model/block-schema.json b/dotcom-rendering/src/model/block-schema.json
index 5751e27c6aa..88f9707623c 100644
--- a/dotcom-rendering/src/model/block-schema.json
+++ b/dotcom-rendering/src/model/block-schema.json
@@ -2895,9 +2895,6 @@
"type": "string",
"const": "model.dotcomrendering.pageElements.YoutubeBlockElement"
},
- "elementId": {
- "type": "string"
- },
"assetId": {
"type": "string"
},
@@ -2947,7 +2944,6 @@
"required": [
"_type",
"assetId",
- "elementId",
"expired",
"id",
"mediaTitle"
diff --git a/dotcom-rendering/src/model/enhanceCards.ts b/dotcom-rendering/src/model/enhanceCards.ts
index a113dadb0bb..bd3ecfb19ee 100644
--- a/dotcom-rendering/src/model/enhanceCards.ts
+++ b/dotcom-rendering/src/model/enhanceCards.ts
@@ -225,7 +225,7 @@ const getActiveMediaAtom = (mediaAtom?: FEMediaAtom): MainMedia | undefined => {
if (asset?.platform === 'Youtube') {
return {
type: 'Video',
- elementId: mediaAtom.id,
+ id: mediaAtom.id,
videoId: asset.id,
duration: mediaAtom.duration ?? 0,
title: mediaAtom.title,
diff --git a/dotcom-rendering/src/model/front-schema.json b/dotcom-rendering/src/model/front-schema.json
index 9f2dfa8f0af..249bfcb335e 100644
--- a/dotcom-rendering/src/model/front-schema.json
+++ b/dotcom-rendering/src/model/front-schema.json
@@ -3577,7 +3577,7 @@
"type": "string",
"const": "Video"
},
- "elementId": {
+ "id": {
"type": "string"
},
"videoId": {
@@ -3622,7 +3622,6 @@
},
"required": [
"duration",
- "elementId",
"expired",
"height",
"images",
diff --git a/dotcom-rendering/src/types/content.ts b/dotcom-rendering/src/types/content.ts
index 8f07bd29e7e..c5a9269e30d 100644
--- a/dotcom-rendering/src/types/content.ts
+++ b/dotcom-rendering/src/types/content.ts
@@ -552,7 +552,6 @@ export interface VideoYoutubeBlockElement extends ThirdPartyEmbeddedContent {
export interface YoutubeBlockElement {
_type: 'model.dotcomrendering.pageElements.YoutubeBlockElement';
- elementId: string;
assetId: string;
mediaTitle: string;
id: string;
diff --git a/dotcom-rendering/src/types/mainMedia.ts b/dotcom-rendering/src/types/mainMedia.ts
index dbb21ca7d38..f8b89fc620b 100644
--- a/dotcom-rendering/src/types/mainMedia.ts
+++ b/dotcom-rendering/src/types/mainMedia.ts
@@ -5,7 +5,8 @@ type Media = {
/** For displaying embedded, playable videos directly in cards */
type Video = Media & {
type: 'Video';
- elementId: string;
+ /** @see https://github.com/guardian/frontend/blob/8e7e4d0e/common/app/model/content/Atom.scala#L159 */
+ id?: string;
videoId: string;
height: number;
width: number;