@@ -2,20 +2,20 @@ import type { FEMediaAsset, FEMediaAtom } from '../frontend/feFront';
22import { getActiveMediaAtom } from './enhanceCards' ;
33
44describe ( 'Enhance Cards' , ( ) => {
5- it ( 'filters out m3u8 assets until supported by DCR ' , ( ) => {
5+ it ( 'prioritises m3u8 assets over MP4 assets ' , ( ) => {
66 const videoReplace = true ;
77 const assets : FEMediaAsset [ ] = [
88 {
9- id : 'https://guim-example.co.uk/atomID-1.m3u8 ' ,
9+ id : 'https://guim-example.co.uk/atomID-1.mp4 ' ,
1010 version : 1 ,
1111 platform : 'Url' ,
12- mimeType : 'application/vnd.apple.mpegurl ' ,
12+ mimeType : 'video/mp4 ' ,
1313 } ,
1414 {
15- id : 'https://guim-example.co.uk/atomID-1.mp4 ' ,
15+ id : 'https://guim-example.co.uk/atomID-1.m3u8 ' ,
1616 version : 1 ,
1717 platform : 'Url' ,
18- mimeType : 'video/mp4 ' ,
18+ mimeType : 'application/x-mpegURL ' ,
1919 } ,
2020 ] ;
2121 const mediaAtom : FEMediaAtom = {
@@ -39,7 +39,16 @@ describe('Enhance Cards', () => {
3939 height : 400 ,
4040 image : '' ,
4141 type : 'LoopVideo' ,
42- videoId : 'https://guim-example.co.uk/atomID-1.mp4' ,
42+ sources : [
43+ {
44+ mimeType : 'application/x-mpegURL' ,
45+ src : 'https://guim-example.co.uk/atomID-1.m3u8' ,
46+ } ,
47+ {
48+ mimeType : 'video/mp4' ,
49+ src : 'https://guim-example.co.uk/atomID-1.mp4' ,
50+ } ,
51+ ] ,
4352 width : 500 ,
4453 } ) ;
4554 } ) ;
0 commit comments