Skip to content

Commit

Permalink
fix(FEC-12084): OVP Provider doesn't play entries of partner 0 (#174)
Browse files Browse the repository at this point in the history
enable partner 0 

Solves FEC-12084
  • Loading branch information
yairans authored Mar 29, 2022
1 parent 647b4bb commit c736951
Show file tree
Hide file tree
Showing 5 changed files with 352 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/k-provider/ovp/play-source-url-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export default class PlaySourceUrlBuilder {
const {partnerId, entryId, ks, uiConfId, format, protocol, extension, flavorIds} = urlParams;

//verify mandatory params
if (!serviceUrlOrigin || !partnerId || !entryId || !format || !protocol) {
//$FlowFixMe
if (!serviceUrlOrigin || isNaN(Number.parseInt(partnerId)) || !entryId || !format || !protocol) {
return '';
}

Expand Down
237 changes: 236 additions & 1 deletion test/src/k-provider/ovp/be-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3656,6 +3656,240 @@ const Session = {
]
};

const Partner0EntryData = {
response: [
{
objects: [
{
mediaType: 1,
dataUrl: 'https://cdnapisec.kaltura.com/p/1645161/sp/164516100/playManifest/entryId/0_pi55vv3r/format/url/protocol/https',
flavorParamsIds: '0,487051',
duration: 11,
msDuration: 11312,
id: '0_pi55vv3r',
name: 'Titanic in 5 Seconds',
description: 'Titanic movie summarized in 5 seconds',
tags: 'titanic, short',
status: 2,
type: 1,
thumbnailUrl: 'https://cfvod.kaltura.com/p/1645161/sp/164516100/thumbnail/entry_id/0_pi55vv3r/version/100002',
objectType: 'KalturaMediaEntry'
}
],
totalCount: 1,
objectType: 'KalturaBaseEntryListResponse'
},
{
sources: [
{
deliveryProfileId: 5642,
format: 'url',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/5642/protocol/https/format/url/name/a.mp4',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 3382,
format: 'hdnetworkmanifest',
protocols: 'https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/3382/protocol/https/format/hdnetworkmanifest/manifest.f4m',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 4662,
format: 'mpegdash',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/4662/protocol/https/format/mpegdash/manifest.mpd',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 72,
format: 'url',
protocols: 'http',
flavorIds: '0_6gg99kvm',
url:
'http://cdnapi.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/72/protocol/http/format/url/name/a.mp4',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 92,
format: 'url',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/92/protocol/https/format/url/name/a.mp4',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 102,
format: 'hdnetwork',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/102/protocol/https/format/hdnetwork/manifest.f4m',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 13942,
format: 'applehttp',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/13942/protocol/https/format/applehttp/a.m3u8',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 122,
format: 'rtsp',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/122/protocol/https/format/rtsp/name/a.3gp',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 13952,
format: 'applehttp',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/13952/protocol/https/format/applehttp/a.m3u8',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 21633,
format: 'applehttp',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/21633/protocol/https/format/applehttp/a.m3u8',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 132,
format: 'hdnetworkmanifest',
protocols: 'http',
flavorIds: '0_6gg99kvm',
url:
'http://cdnapi.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/132/protocol/http/format/hdnetworkmanifest/manifest.f4m',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 152,
format: 'rtmp',
protocols: 'rtmp,rtmpe,rtmpt,rtmpte',
flavorIds: '0_6gg99kvm',
url:
'http://cdnapi.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/152/protocol/http/format/rtmp/a.f4m',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 162,
format: 'rtmp',
protocols: 'rtmp,rtmpe,rtmpt,rtmpte',
flavorIds: '0_6gg99kvm',
url:
'http://cdnapi.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/162/protocol/http/format/rtmp/a.f4m',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 12972,
format: 'mpegdash',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/12972/protocol/https/format/mpegdash/manifest.mpd',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 5552,
format: 'url',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/5552/protocol/https/format/url/name/a.mp4',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 5612,
format: 'hdnetworkmanifest',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/5612/protocol/https/format/hdnetworkmanifest/manifest.f4m',
drm: [],
objectType: 'KalturaPlaybackSource'
},
{
deliveryProfileId: 5622,
format: 'hdnetworkmanifest',
protocols: 'http,https',
flavorIds: '0_6gg99kvm',
url:
'https://cdnapisec.kaltura.com/p/1645161/sp/1645161/playManifest/entryId/0_pi55vv3r/flavorIds/0_6gg99kvm/deliveryProfileId/5622/protocol/https/format/hdnetworkmanifest/manifest.f4m',
drm: [],
objectType: 'KalturaPlaybackSource'
}
],
playbackCaptions: [],
flavorAssets: [
{
flavorParamsId: 487051,
width: 320,
height: 240,
bitrate: 274,
frameRate: 29.97,
isOriginal: false,
isWeb: true,
containerFormat: 'isom',
videoCodecId: 'avc1',
status: 2,
language: 'Undefined',
isDefault: false,
id: '0_6gg99kvm',
entryId: '0_pi55vv3r',
partnerId: 1645161,
version: '2',
size: 378,
tags: 'mobile,web,mbr,iphone,iphonenew,ipad,ipadnew,dash',
fileExt: 'mp4',
createdAt: 1564401389,
updatedAt: 1564401403,
description: 'video warnings: 2107,280,600#The target flavor bitrate (280) does not comply with the requested bitrate (600).\n',
sizeInBytes: 0,
objectType: 'KalturaFlavorAsset'
}
],
actions: [],
messages: [],
bumperData: [],
objectType: 'KalturaPlaybackContext'
},
{objects: [], totalCount: 0, objectType: 'KalturaMetadataListResponse'}
]
};

export {
AnonymousMocEntryWithoutUIConfNoDrmData,
BlockActionEntry,
Expand All @@ -3680,5 +3914,6 @@ export {
EntryWithBumper as EntryExternalCaptionNoKS,
EntryWithBumperWithKs as EntryExternalCaptionWithKS,
EntryDirectWithKs,
Session
Session,
Partner0EntryData
};
73 changes: 72 additions & 1 deletion test/src/k-provider/ovp/media-config-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,76 @@ const EntryWithNoBumper = {
plugins: {}
};

const EntryOfPartner0 = {
session: {
isAnonymous: false,
partnerId: 0,
ks:
'djJ8MTY0NTE2MXzvlA0ktfU5h5Q_sBfvomsONiVGDO4zRRaJHvTBmnxd9eGmGQq3yvwzedJ8elff4L85A8hbCNE5rhDZsPMqDBFT_cfr1ytLeTLyEhS_ZjyYzEpZWUxzrsXjvgiSo9np4Y9H1pH6avyV4TpknfDDX20H59wjh3QhpZRn3DLryzgoTQ'
},
sources: {
hls: [
{
id: '0_pi55vv3r_13942,applehttp',
url:
'https://cdnapisec.kaltura.com/p/0/sp/000/playManifest/entryId/0_pi55vv3r/protocol/https/format/applehttp/flavorIds/0_6gg99kvm/ks/djJ8MTY0NTE2MXzvlA0ktfU5h5Q_sBfvomsONiVGDO4zRRaJHvTBmnxd9eGmGQq3yvwzedJ8elff4L85A8hbCNE5rhDZsPMqDBFT_cfr1ytLeTLyEhS_ZjyYzEpZWUxzrsXjvgiSo9np4Y9H1pH6avyV4TpknfDDX20H59wjh3QhpZRn3DLryzgoTQ/a.m3u8',
mimetype: 'application/x-mpegURL'
},
{
id: '0_pi55vv3r_13952,applehttp',
url:
'https://cdnapisec.kaltura.com/p/0/sp/000/playManifest/entryId/0_pi55vv3r/protocol/https/format/applehttp/flavorIds/0_6gg99kvm/ks/djJ8MTY0NTE2MXzvlA0ktfU5h5Q_sBfvomsONiVGDO4zRRaJHvTBmnxd9eGmGQq3yvwzedJ8elff4L85A8hbCNE5rhDZsPMqDBFT_cfr1ytLeTLyEhS_ZjyYzEpZWUxzrsXjvgiSo9np4Y9H1pH6avyV4TpknfDDX20H59wjh3QhpZRn3DLryzgoTQ/a.m3u8',
mimetype: 'application/x-mpegURL'
},
{
id: '0_pi55vv3r_21633,applehttp',
url:
'https://cdnapisec.kaltura.com/p/0/sp/000/playManifest/entryId/0_pi55vv3r/protocol/https/format/applehttp/flavorIds/0_6gg99kvm/ks/djJ8MTY0NTE2MXzvlA0ktfU5h5Q_sBfvomsONiVGDO4zRRaJHvTBmnxd9eGmGQq3yvwzedJ8elff4L85A8hbCNE5rhDZsPMqDBFT_cfr1ytLeTLyEhS_ZjyYzEpZWUxzrsXjvgiSo9np4Y9H1pH6avyV4TpknfDDX20H59wjh3QhpZRn3DLryzgoTQ/a.m3u8',
mimetype: 'application/x-mpegURL'
}
],
dash: [
{
id: '0_pi55vv3r_4662,mpegdash',
url:
'https://cdnapisec.kaltura.com/p/0/sp/000/playManifest/entryId/0_pi55vv3r/protocol/https/format/mpegdash/flavorIds/0_6gg99kvm/ks/djJ8MTY0NTE2MXzvlA0ktfU5h5Q_sBfvomsONiVGDO4zRRaJHvTBmnxd9eGmGQq3yvwzedJ8elff4L85A8hbCNE5rhDZsPMqDBFT_cfr1ytLeTLyEhS_ZjyYzEpZWUxzrsXjvgiSo9np4Y9H1pH6avyV4TpknfDDX20H59wjh3QhpZRn3DLryzgoTQ/a.mpd',
mimetype: 'application/dash+xml'
},
{
id: '0_pi55vv3r_12972,mpegdash',
url:
'https://cdnapisec.kaltura.com/p/0/sp/000/playManifest/entryId/0_pi55vv3r/protocol/https/format/mpegdash/flavorIds/0_6gg99kvm/ks/djJ8MTY0NTE2MXzvlA0ktfU5h5Q_sBfvomsONiVGDO4zRRaJHvTBmnxd9eGmGQq3yvwzedJ8elff4L85A8hbCNE5rhDZsPMqDBFT_cfr1ytLeTLyEhS_ZjyYzEpZWUxzrsXjvgiSo9np4Y9H1pH6avyV4TpknfDDX20H59wjh3QhpZRn3DLryzgoTQ/a.mpd',
mimetype: 'application/dash+xml'
}
],
progressive: [
{
id: '0_6gg99kvm5642,url',
url:
'https://cdnapisec.kaltura.com/p/0/sp/000/playManifest/entryId/0_pi55vv3r/protocol/https/format/url/flavorIds/0_6gg99kvm/ks/djJ8MTY0NTE2MXzvlA0ktfU5h5Q_sBfvomsONiVGDO4zRRaJHvTBmnxd9eGmGQq3yvwzedJ8elff4L85A8hbCNE5rhDZsPMqDBFT_cfr1ytLeTLyEhS_ZjyYzEpZWUxzrsXjvgiSo9np4Y9H1pH6avyV4TpknfDDX20H59wjh3QhpZRn3DLryzgoTQ/a.mp4',
mimetype: 'video/mp4',
bandwidth: 280576,
width: 320,
height: 240,
label: 'Undefined'
}
],
id: '0_pi55vv3r',
duration: 11,
type: 'Vod',
poster: 'https://cfvod.kaltura.com/p/1645161/sp/164516100/thumbnail/entry_id/0_pi55vv3r/version/100002',
dvr: false,
vr: null,
metadata: {
name: 'Titanic in 5 Seconds',
description: 'Titanic movie summarized in 5 seconds',
tags: 'titanic, short'
},
captions: []
},
plugins: {}
};

export {
NoPluginsNoDrm,
RegexAppliedSources,
Expand All @@ -1250,5 +1320,6 @@ export {
WrongUiConfID,
EntryWithBumper,
EntryWithBumperWithKs,
EntryWithNoBumper
EntryWithNoBumper,
EntryOfPartner0
};
4 changes: 2 additions & 2 deletions test/src/k-provider/ovp/provider-parser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('provider parser', function () {
it('should return a valid adaptive source for a valid input', () => {
const context = new KalturaPlaybackContext({});
context.flavorAssets = kalturaDashSourceFlavorAssets;
const adaptiveSource = OVPProviderParser._parseAdaptiveSource(kalturaDashSource, context, 'myKS', 'myPid', 1234, 1234);
const adaptiveSource = OVPProviderParser._parseAdaptiveSource(kalturaDashSource, context, 'myKS', '4321', 1234, 1234);
adaptiveSource.should.exist;
adaptiveSource.id.should.equal('1234_911,mpegdash');
adaptiveSource.mimetype.should.equal('application/dash+xml');
Expand All @@ -35,7 +35,7 @@ describe('provider parser', function () {
it('should return null if play url is empty', () => {
const context = new KalturaPlaybackContext({});
context.flavorAssets = kalturaSourceProtocolMismatchFlavorAssets;
const adaptiveSource = OVPProviderParser._parseAdaptiveSource(kalturaSourceProtocolMismatch, context, 'myKS', 'myPid', 1234, 1234);
const adaptiveSource = OVPProviderParser._parseAdaptiveSource(kalturaSourceProtocolMismatch, context, 'myKS', 4321, 1234, 1234);
(adaptiveSource === null).should.be.true;
});
});
Expand Down
Loading

0 comments on commit c736951

Please sign in to comment.