Skip to content

Commit

Permalink
fix(FEC-14047): playkit-js-providers - add aspectRatio to media metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
SivanA-Kaltura authored Jul 22, 2024
1 parent 3d6d02a commit 5432c2a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
5 changes: 1 addition & 4 deletions src/k-provider/ovp/provider-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
18 changes: 7 additions & 11 deletions test/src/k-provider/ovp/media-config-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const NoPluginsNoDrm = {
HLSOnly: 'android',
ChannelName: 'Disney Channel SE',
tags: '',
heightRatio: 0.56
aspectRatio: 1.78
},
progressive: [
{
Expand Down Expand Up @@ -290,7 +290,7 @@ const RegexAppliedPlayManifestSources = {
ScheduleSource: 'VOD',
HLSOnly: 'android',
ChannelName: 'Disney Channel SE',
heightRatio: 0.56
aspectRatio: 1.78
},
downloadUrl: ''
},
Expand Down Expand Up @@ -436,7 +436,7 @@ const RegexAppliedAllSources = {
ScheduleSource: 'VOD',
HLSOnly: 'android',
ChannelName: 'Disney Channel SE',
heightRatio: 0.56
aspectRatio: 1.78
},
captions: [
{
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -554,7 +554,7 @@ const WithPluginsNoDrm = {
HLSOnly: 'android',
ChannelName: 'Disney Channel SE',
tags: '',
heightRatio: 0.56
aspectRatio: 1.78
},
progressive: [
{
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -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: [
{
Expand Down Expand Up @@ -1185,7 +1184,6 @@ const EntryWithBumper = {
tags: '',
MediaType: 'Movie',
WatchPermissionRule: 'Parrent Allowed',
heightRatio: 1.78
},
captions: [
{
Expand Down Expand Up @@ -1304,7 +1302,6 @@ const EntryWithBumperWithKs = {
tags: '',
MediaType: 'Movie',
WatchPermissionRule: 'Parrent Allowed',
heightRatio: 1.78
},
captions: [
{
Expand Down Expand Up @@ -1426,7 +1423,6 @@ const EntryWithNoBumper = {
tags: '',
MediaType: 'Movie',
WatchPermissionRule: 'Parrent Allowed',
heightRatio: 1.78
},
captions: [
{
Expand Down Expand Up @@ -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: ''
Expand Down
1 change: 0 additions & 1 deletion test/src/k-provider/ovp/provider-parser-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 5432c2a

Please sign in to comment.