Skip to content

Commit 64be71a

Browse files
committed
Show the video full width on mobile
1 parent 071aa7f commit 64be71a

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

dotcom-rendering/src/components/SelfHostedVideo.importable.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { css } from '@emotion/react';
22
import { log, storage } from '@guardian/libs';
3-
import { space } from '@guardian/source/foundations';
3+
import { from, space } from '@guardian/source/foundations';
44
import { SvgAudio, SvgAudioMute } from '@guardian/source/react-components';
55
import { useCallback, useEffect, useRef, useState } from 'react';
66
import {
@@ -41,7 +41,12 @@ const videoAndBackgroundStyles = css`
4141
const videoContainerStyles = (width: number, height: number) => css`
4242
position: relative;
4343
height: 100%;
44-
width: ${(width / height) * 80}%;
44+
max-height: 100vh;
45+
max-height: 100svh;
46+
max-width: 100%;
47+
${from.tablet} {
48+
max-width: ${(width / height) * 80}%;
49+
}
4550
`;
4651

4752
const cinemagraphContainerStyles = css`

dotcom-rendering/src/frontend/schemas/feFront.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3240,6 +3240,14 @@
32403240
"activeVersion": {
32413241
"type": "number"
32423242
},
3243+
"videoPlayerFormat": {
3244+
"enum": [
3245+
"Cinemagraph",
3246+
"Default",
3247+
"Loop"
3248+
],
3249+
"type": "string"
3250+
},
32433251
"dimensions": {
32443252
"type": "object",
32453253
"properties": {
@@ -4092,4 +4100,4 @@
40924100
}
40934101
},
40944102
"$schema": "http://json-schema.org/draft-07/schema#"
4095-
}
4103+
}

dotcom-rendering/src/frontend/schemas/feTagPage.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,14 @@
14131413
"activeVersion": {
14141414
"type": "number"
14151415
},
1416+
"videoPlayerFormat": {
1417+
"enum": [
1418+
"Cinemagraph",
1419+
"Default",
1420+
"Loop"
1421+
],
1422+
"type": "string"
1423+
},
14161424
"dimensions": {
14171425
"type": "object",
14181426
"properties": {
@@ -2006,4 +2014,4 @@
20062014
}
20072015
},
20082016
"$schema": "http://json-schema.org/draft-07/schema#"
2009-
}
2017+
}

0 commit comments

Comments
 (0)