From 222bdf18e0dafb0f33a6ce994ffdede123a3a8fa Mon Sep 17 00:00:00 2001 From: SivanA-Kaltura <88330203+SivanA-Kaltura@users.noreply.github.com> Date: Sun, 21 Jul 2024 10:13:33 +0300 Subject: [PATCH] update aspect ratio calculation --- src/k-provider/ovp/provider-parser.ts | 5 +---- test/src/k-provider/ovp/media-config-data.js | 18 +++++++----------- .../src/k-provider/ovp/provider-parser-data.js | 1 - 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/k-provider/ovp/provider-parser.ts b/src/k-provider/ovp/provider-parser.ts index 8a174932..3caad4be 100644 --- a/src/k-provider/ovp/provider-parser.ts +++ b/src/k-provider/ovp/provider-parser.ts @@ -179,11 +179,8 @@ class OVPProviderParser { playbackContext.flavorAssets[0].width && playbackContext.flavorAssets[0].height) { const {height, width} = playbackContext.flavorAssets[0]; - mediaEntry.metadata.heightRatio = +Number(height / width).toFixed(2); - } else { - mediaEntry.metadata.heightRatio = 1.78; + mediaEntry.metadata.aspectRatio = +Number(width / height).toFixed(2); } - return mediaEntry; } diff --git a/test/src/k-provider/ovp/media-config-data.js b/test/src/k-provider/ovp/media-config-data.js index 92cf7ca0..65b20171 100644 --- a/test/src/k-provider/ovp/media-config-data.js +++ b/test/src/k-provider/ovp/media-config-data.js @@ -35,7 +35,7 @@ const NoPluginsNoDrm = { HLSOnly: 'android', ChannelName: 'Disney Channel SE', tags: '', - heightRatio: 0.56 + aspectRatio: 1.78 }, progressive: [ { @@ -290,7 +290,7 @@ const RegexAppliedPlayManifestSources = { ScheduleSource: 'VOD', HLSOnly: 'android', ChannelName: 'Disney Channel SE', - heightRatio: 0.56 + aspectRatio: 1.78 }, downloadUrl: '' }, @@ -436,7 +436,7 @@ const RegexAppliedAllSources = { ScheduleSource: 'VOD', HLSOnly: 'android', ChannelName: 'Disney Channel SE', - heightRatio: 0.56 + aspectRatio: 1.78 }, captions: [ { @@ -472,7 +472,7 @@ const NoPluginsWithDrm = { description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vel semper libero. Curabitur in felis elementum, porttitor sem ac, volutpat mi. Sed dignissim facilisis magna, ac suscipit orci suscipit id. Suspendisse feugiat sapien laoreet auctor convallis. Cras volutpat dictum massa, in pharetra erat placerat eget. Donec at elit est. Donec id cursus elit. Etiam sit amet sapien sed mi aliquam finibus at lobortis diam. Aenean at gravida libero.', tags: '', - heightRatio: 0.57 + aspectRatio: 1.76 }, progressive: [], dash: [ @@ -554,7 +554,7 @@ const WithPluginsNoDrm = { HLSOnly: 'android', ChannelName: 'Disney Channel SE', tags: '', - heightRatio: 0.56 + aspectRatio: 1.78 }, progressive: [ { @@ -683,7 +683,7 @@ const WithPluginsWithDrm = { description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vel semper libero. Curabitur in felis elementum, porttitor sem ac, volutpat mi. Sed dignissim facilisis magna, ac suscipit orci suscipit id. Suspendisse feugiat sapien laoreet auctor convallis. Cras volutpat dictum massa, in pharetra erat placerat eget. Donec at elit est. Donec id cursus elit. Etiam sit amet sapien sed mi aliquam finibus at lobortis diam. Aenean at gravida libero.', tags: '', - heightRatio: 0.57 + aspectRatio: 1.76 }, progressive: [], dash: [ @@ -748,7 +748,6 @@ const AudioEntryWithoutPlugins = { description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vel semper libero. Curabitur in felis elementum, porttitor sem ac, volutpat mi. Sed dignissim facilisis magna, ac suscipit orci suscipit id. Suspendisse feugiat sapien laoreet auctor convallis. Cras volutpat dictum massa, in pharetra erat placerat eget. Donec at elit est. Donec id cursus elit. Etiam sit amet sapien sed mi aliquam finibus at lobortis diam. Aenean at gravida libero.', tags: 'dual audio, english, spanish', - heightRatio: 1.78 }, progressive: [ { @@ -1185,7 +1184,6 @@ const EntryWithBumper = { tags: '', MediaType: 'Movie', WatchPermissionRule: 'Parrent Allowed', - heightRatio: 1.78 }, captions: [ { @@ -1304,7 +1302,6 @@ const EntryWithBumperWithKs = { tags: '', MediaType: 'Movie', WatchPermissionRule: 'Parrent Allowed', - heightRatio: 1.78 }, captions: [ { @@ -1426,7 +1423,6 @@ const EntryWithNoBumper = { tags: '', MediaType: 'Movie', WatchPermissionRule: 'Parrent Allowed', - heightRatio: 1.78 }, captions: [ { @@ -1518,7 +1514,7 @@ const EntryOfPartner0 = { entryId: '0_pi55vv3r', description: 'Titanic movie summarized in 5 seconds', tags: 'titanic, short', - heightRatio: 0.75 + aspectRatio: 1.33 }, captions: [], downloadUrl: '' diff --git a/test/src/k-provider/ovp/provider-parser-data.js b/test/src/k-provider/ovp/provider-parser-data.js index 36e86b7f..f5f9c098 100644 --- a/test/src/k-provider/ovp/provider-parser-data.js +++ b/test/src/k-provider/ovp/provider-parser-data.js @@ -79,7 +79,6 @@ const youtubeMediaEntryResult = { description: 'youtube description', name: 'test youtube entry', tags: '', - heightRatio: 1.78, }, type: 'Unknown', poster: 'https://cfvod.kaltura.com/p/1111/sp/1111/thumbnail/entry_id/1234/version/100001',