Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FEC-14071): thumbnail requests append height, width, ks too many times #243

Merged
merged 3 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/entities/media-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export default class MediaEntry {
*/
public downloadUrl?: string;

/**
* @member - The raw thumbnail URL
* @type {string}
*/
public rawThumbnailUrl?: string;

/**
* @constructor
*/
Expand All @@ -99,7 +105,8 @@ export default class MediaEntry {
type: this.type,
poster: this.poster,
assetReferenceType: this.assetReferenceType,
downloadUrl: this.downloadUrl
downloadUrl: this.downloadUrl,
rawThumbnailUrl: this.rawThumbnailUrl
};
}
}
1 change: 1 addition & 0 deletions src/k-provider/ovp/provider-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class OVPProviderParser {

private static _fillBaseData(mediaEntry: MediaEntry, entry: KalturaMediaEntry, metadataList?: KalturaMetadataListResponse, playbackContext?: any): MediaEntry {
mediaEntry.poster = entry.poster;
mediaEntry.rawThumbnailUrl = entry.rawThumbnailUrl;
mediaEntry.id = entry.id;
mediaEntry.duration = entry.duration;
mediaEntry.downloadUrl = entry.downloadUrl || '';
Expand Down
2 changes: 2 additions & 0 deletions src/k-provider/ovp/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
duration: 0,
type: MediaEntry.Type.UNKNOWN,
poster: '',
rawThumbnailUrl: '',
dvr: false,
vr: null,
metadata: {
Expand All @@ -349,6 +350,7 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
sourcesObject.type = mediaEntry.type;
sourcesObject.dvr = !!mediaEntry.dvrStatus;
sourcesObject.poster = mediaEntry.poster;
sourcesObject.rawThumbnailUrl = mediaEntry.rawThumbnailUrl;
SivanA-Kaltura marked this conversation as resolved.
Show resolved Hide resolved
sourcesObject.downloadUrl = mediaEntry.downloadUrl;
if (mediaEntry.sources.captions) {
sourcesObject.captions = mediaEntry.sources.captions;
Expand Down
7 changes: 7 additions & 0 deletions src/k-provider/ovp/response-types/kaltura-media-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ export class KalturaMediaEntry {
*/
public creatorId: string;

/**
* @member - The raw thumbnail URL
* @type {string}
*/
public rawThumbnailUrl: string;

/**
* @constructor
* @param {Object} entry The json response
Expand All @@ -185,5 +191,6 @@ export class KalturaMediaEntry {
this.plays = entry.plays;
this.views = entry.views;
this.downloadUrl = entry.downloadUrl;
this.rawThumbnailUrl = entry.thumbnailUrl;
SivanA-Kaltura marked this conversation as resolved.
Show resolved Hide resolved
}
}
1 change: 1 addition & 0 deletions src/types/media-config-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export type ProviderMediaConfigSourcesObject = {
metadata: ProviderMediaConfigMetadataObject;
captions?: Array<PKExternalCaptionObject>;
downloadUrl?: string;
rawThumbnailUrl?: string;
};
1 change: 1 addition & 0 deletions src/types/media-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export type ProviderMediaEntryObject = {
poster?: string | Poster[];
downloadUrl?: string;
assetReferenceType?: string;
rawThumbnailUrl?: string;
};
12 changes: 12 additions & 0 deletions test/src/k-provider/ovp/media-config-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const NoPluginsNoDrm = {
vr: null,
type: 'Vod',
poster: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
rawThumbnailUrl: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
metadata: {
entryId: '1_rsrdfext',
name: 'FO21934-HDTX-SWE',
Expand Down Expand Up @@ -266,6 +267,7 @@ const RegexAppliedPlayManifestSources = {
duration: 55,
type: 'Vod',
poster: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
rawThumbnailUrl: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
dvr: false,
vr: null,
metadata: {
Expand Down Expand Up @@ -412,6 +414,7 @@ const RegexAppliedAllSources = {
type: 'Vod',
poster:
'http://qa-kes-ebu-01.dev.kaltura.com/kAPI/kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
rawThumbnailUrl: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
dvr: false,
vr: null,
metadata: {
Expand Down Expand Up @@ -466,6 +469,7 @@ const NoPluginsWithDrm = {
vr: null,
type: 'Vod',
poster: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
rawThumbnailUrl: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
metadata: {
entryId: '1_rwbj3j0a',
name: 'DRM TEST',
Expand Down Expand Up @@ -532,6 +536,7 @@ const WithPluginsNoDrm = {
vr: null,
type: 'Vod',
poster: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
rawThumbnailUrl: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
metadata: {
entryId: '1_rsrdfext',
name: 'FO21934-HDTX-SWE',
Expand Down Expand Up @@ -677,6 +682,7 @@ const WithPluginsWithDrm = {
vr: null,
type: 'Vod',
poster: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
rawThumbnailUrl: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
metadata: {
entryId: '1_rwbj3j0a',
name: 'DRM TEST',
Expand Down Expand Up @@ -742,6 +748,7 @@ const AudioEntryWithoutPlugins = {
vr: null,
type: 'Audio',
poster: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
rawThumbnailUrl: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
metadata: {
entryId: '0_vyzw3ceu',
name: 'TEST_WAESP_PLACINGTEST_DUAL',
Expand Down Expand Up @@ -805,6 +812,7 @@ const ImageEntryWithoutPlugins = {
vr: null,
type: 'Image',
poster: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
rawThumbnailUrl: 'http://kaltura.com/p/1082342/sp/108234200/thumbnail/entry_id/1_rsrdfext/version/100002/width/640/height/360',
metadata: {
entryId: '0_84zz779s',
name: 'Channel HU-TEST-STG-Attila-160203 Thumbnail',
Expand Down Expand Up @@ -1175,6 +1183,7 @@ const EntryWithBumper = {
duration: 741,
type: 'Vod',
poster: 'http://cdntesting.qa.mkaltura.com/p/1091/sp/109100/thumbnail/entry_id/0_wifqaipd/version/100042',
rawThumbnailUrl: 'http://cdntesting.qa.mkaltura.com/p/1091/sp/109100/thumbnail/entry_id/0_wifqaipd/version/100042',
dvr: false,
vr: null,
metadata: {
Expand Down Expand Up @@ -1293,6 +1302,7 @@ const EntryWithBumperWithKs = {
duration: 741,
type: 'Vod',
poster: 'http://cdntesting.qa.mkaltura.com/p/1091/sp/109100/thumbnail/entry_id/0_wifqaipd/version/100042',
rawThumbnailUrl: 'http://cdntesting.qa.mkaltura.com/p/1091/sp/109100/thumbnail/entry_id/0_wifqaipd/version/100042',
dvr: false,
vr: null,
metadata: {
Expand Down Expand Up @@ -1414,6 +1424,7 @@ const EntryWithNoBumper = {
duration: 741,
type: 'Vod',
poster: 'http://cdntesting.qa.mkaltura.com/p/1091/sp/109100/thumbnail/entry_id/0_wifqaipd/version/100042',
rawThumbnailUrl: 'http://cdntesting.qa.mkaltura.com/p/1091/sp/109100/thumbnail/entry_id/0_wifqaipd/version/100042',
dvr: false,
vr: null,
metadata: {
Expand Down Expand Up @@ -1507,6 +1518,7 @@ const EntryOfPartner0 = {
duration: 11,
type: 'Vod',
poster: 'https://cfvod.kaltura.com/p/1645161/sp/164516100/thumbnail/entry_id/0_pi55vv3r/version/100002',
rawThumbnailUrl: 'https://cfvod.kaltura.com/p/1645161/sp/164516100/thumbnail/entry_id/0_pi55vv3r/version/100002',
dvr: false,
vr: null,
metadata: {
Expand Down
Loading