Skip to content

Commit c02c6d4

Browse files
committed
Re-enable HLS
1 parent 2bf21d0 commit c02c6d4

File tree

5 files changed

+47
-41
lines changed

5 files changed

+47
-41
lines changed

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,26 @@ export const Loop5to4: Story = {
3838
'https://media.guim.co.uk/9bdb802e6da5d3fd249b5060f367b3a817965f0c/0_0_1800_1080/master/1800.jpg',
3939
fallbackImage: '',
4040
},
41-
};
42-
43-
// export const WithM3U8File: Story = {
44-
// name: 'With M3U8 file',
45-
// args: {
46-
// ...Default.args,
47-
// sources: [
48-
// {
49-
// src: 'https://uploads.guimcode.co.uk/2025/09/01/Loop__Japan_fireball--ace3fcf6-1378-41db-9d21-f3fc07072ab2-1.10.m3u8',
50-
// mimeType: 'application/x-mpegURL',
51-
// },
52-
// {
53-
// src: 'https://uploads.guim.co.uk/2025%2F06%2F20%2Ftesting+only%2C+please+ignore--3cb22b60-2c3f-48d6-8bce-38c956907cce-3.mp4',
54-
// mimeType: 'video/mp4',
55-
// },
56-
// ],
57-
// },
58-
// };
59-
60-
export const Loop16to9: Story = {
41+
} satisfies Story;
42+
43+
export const WithM3U8File = {
44+
name: 'With M3U8 file',
45+
args: {
46+
...Loop5to4.args,
47+
sources: [
48+
{
49+
src: 'https://uploads.guimcode.co.uk/2025/09/01/Loop__Japan_fireball--ace3fcf6-1378-41db-9d21-f3fc07072ab2-1.10.m3u8',
50+
mimeType: 'application/x-mpegURL',
51+
},
52+
{
53+
src: 'https://uploads.guim.co.uk/2025%2F06%2F20%2Ftesting+only%2C+please+ignore--3cb22b60-2c3f-48d6-8bce-38c956907cce-3.mp4',
54+
mimeType: 'video/mp4',
55+
},
56+
],
57+
},
58+
} satisfies Story;
59+
60+
export const Loop16to9 = {
6161
name: 'Looping video in 16:9 aspect ratio',
6262
args: {
6363
...Loop5to4.args,
@@ -70,14 +70,14 @@ export const Loop16to9: Story = {
7070
height: 1080,
7171
width: 1920,
7272
},
73-
};
73+
} satisfies Story;
7474

75-
export const WithCinemagraph: Story = {
75+
export const WithCinemagraph = {
7676
args: {
7777
...Loop5to4.args,
7878
videoStyle: 'Cinemagraph',
7979
},
80-
};
80+
} satisfies Story;
8181

8282
export const PausePlay: Story = {
8383
...Loop5to4,
@@ -98,7 +98,7 @@ export const PausePlay: Story = {
9898
await userEvent.click(videoEl);
9999
await expect(canvas.queryByTestId('play-icon')).not.toBeInTheDocument();
100100
},
101-
};
101+
} satisfies Story;
102102

103103
export const UnmuteMute: Story = {
104104
...Loop5to4,
@@ -120,7 +120,7 @@ export const UnmuteMute: Story = {
120120
await userEvent.click(canvas.getByTestId('mute-icon'));
121121
await canvas.findByTestId('unmute-icon');
122122
},
123-
};
123+
} satisfies Story;
124124

125125
// Function to emulate pausing between interactions
126126
function sleep(ms: number) {
@@ -150,4 +150,4 @@ export const InteractionObserver: Story = {
150150
await expect(Number(progressBar.ariaValueNow)).toEqual(progress);
151151
await expect(canvas.queryByTestId('play-icon')).not.toBeInTheDocument();
152152
},
153-
};
153+
} satisfies Story;

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5472,8 +5472,7 @@
54725472
"type": "string"
54735473
},
54745474
"mimeType": {
5475-
"type": "string",
5476-
"const": "video/mp4"
5475+
"$ref": "#/definitions/SupportedVideoFileType"
54775476
}
54785477
},
54795478
"required": [
@@ -5518,6 +5517,14 @@
55185517
],
55195518
"type": "string"
55205519
},
5520+
"SupportedVideoFileType": {
5521+
"enum": [
5522+
"application/vnd.apple.mpegurl",
5523+
"application/x-mpegURL",
5524+
"video/mp4"
5525+
],
5526+
"type": "string"
5527+
},
55215528
"Audio": {
55225529
"allOf": [
55235530
{

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3967,8 +3967,7 @@
39673967
"type": "string"
39683968
},
39693969
"mimeType": {
3970-
"type": "string",
3971-
"const": "video/mp4"
3970+
"$ref": "#/definitions/SupportedVideoFileType"
39723971
}
39733972
},
39743973
"required": [
@@ -4013,6 +4012,14 @@
40134012
],
40144013
"type": "string"
40154014
},
4015+
"SupportedVideoFileType": {
4016+
"enum": [
4017+
"application/vnd.apple.mpegurl",
4018+
"application/x-mpegURL",
4019+
"video/mp4"
4020+
],
4021+
"type": "string"
4022+
},
40164023
"Audio": {
40174024
"allOf": [
40184025
{

dotcom-rendering/src/lib/video.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ export type Source = {
1111

1212
/**
1313
* Order is important here - the browser will use the first type it supports.
14-
* 'application/x-mpegURL' & 'application/vnd.apple.mpegurl' have been filtered out
15-
* whilst a hls chrome bug is investigated
16-
* https://issues.chromium.org/issues/454630434
1714
*/
1815
export const supportedVideoFileTypes = [
19-
// 'application/x-mpegURL', // HLS format
20-
// 'application/vnd.apple.mpegurl', // Alternative HLS format
16+
'application/x-mpegURL', // HLS format
17+
'application/vnd.apple.mpegurl', // Alternative HLS format
2118
'video/mp4', // MP4 format
2219
] as const;
2320

dotcom-rendering/src/model/enhanceCards.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import type { FEMediaAsset, FEMediaAtom } from '../frontend/feFront';
22
import { getActiveMediaAtom } from './enhanceCards';
33

4-
/**
5-
* Why has this test suite been skipped?
6-
*
7-
* M3U8s have been disabled whilst a chrome hls bug is investigated.
8-
*/
9-
describe.skip('Enhance Cards', () => {
4+
describe('Enhance Cards', () => {
105
it('prioritises m3u8 assets over MP4 assets', () => {
116
const videoReplace = true;
127
const assets: FEMediaAsset[] = [

0 commit comments

Comments
 (0)