Skip to content

Commit

Permalink
fix(FEV-1122): switch layout fix (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
semarche-kaltura authored Oct 28, 2021
1 parent 01e88a7 commit 2969ed9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/providers/live/live-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SlideViewChangePushNotificationData,
ThumbPushNotificationData
} from './push-notifications-provider';
import {makeAssetUrl, prepareEndTime} from '../utils';
import {makeAssetUrl} from '../utils';
import Player = KalturaPlayerTypes.Player;
import Logger = KalturaPlayerTypes.Logger;
import EventManager = KalturaPlayerTypes.EventManager;
Expand Down Expand Up @@ -113,7 +113,7 @@ export class LiveProvider extends Provider {
.map((cue, index) => {
// fix endTime and replace VTTCue
if (cue.endTime === Number.MAX_SAFE_INTEGER && index !== cuePoints.length - 1) {
const fixedCue = {...cue, endTime: prepareEndTime(cuePoints[index + 1].startTime)};
const fixedCue = {...cue, endTime: cuePoints[index + 1].startTime};
this._player.cuePointManager.addCuePoints([fixedCue]);
return fixedCue;
}
Expand Down
5 changes: 0 additions & 5 deletions src/providers/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const DEFAULT_SERVICE_URL = '//cdnapisec.kaltura.com/api_v3';
export const END_TIME_DELTA = 0.01;

export function isEmptyObject(obj: Record<string, any>) {
return Object.keys(obj).length === 0 && obj.constructor === Object;
Expand All @@ -12,7 +11,3 @@ export function getDomainFromUrl(url: string) {
export function makeAssetUrl(serviceUrl: string = DEFAULT_SERVICE_URL, assetId: string, ks: string = '') {
return `${serviceUrl}/index.php/service/thumbAsset/action/serve/thumbAssetId/${assetId}/ks/${ks}`;
}

export function prepareEndTime(endTime: number) {
return endTime - END_TIME_DELTA;
}
4 changes: 2 additions & 2 deletions src/providers/vod/vod-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {KalturaCuePointType, KalturaThumbCuePointSubType, CuepointTypeMap} from
import Player = KalturaPlayerTypes.Player;
import Logger = KalturaPlayerTypes.Logger;
import EventManager = KalturaPlayerTypes.EventManager;
import {makeAssetUrl, prepareEndTime} from '../utils';
import {makeAssetUrl} from '../utils';
import {ViewChangeLoader} from './view-change-loader';
import {KalturaCodeCuePoint} from './response-types/kaltura-code-cue-point';

Expand Down Expand Up @@ -63,7 +63,7 @@ export class VodProvider extends Provider {
if (cuePoint.endTime === Number.MAX_SAFE_INTEGER && index !== cuePoints.length - 1) {
return {
...cuePoint,
endTime: prepareEndTime(cuePoints[index + 1].startTime)
endTime: cuePoints[index + 1].startTime
};
}
return cuePoint;
Expand Down

0 comments on commit 2969ed9

Please sign in to comment.