From da87f0d3e972a7690af062f5de2a44c0d9b8a65e Mon Sep 17 00:00:00 2001 From: SivanA-Kaltura <88330203+SivanA-Kaltura@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:21:02 +0300 Subject: [PATCH 1/2] add enableCache field --- src/kaltura-player.ts | 4 +++- src/types/playback-config.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kaltura-player.ts b/src/kaltura-player.ts index dc6f99419..2a736e08d 100644 --- a/src/kaltura-player.ts +++ b/src/kaltura-player.ts @@ -1174,7 +1174,9 @@ export class KalturaPlayer extends FakeEventTarget { } public setCachedUrls(urls: string[]): void { - this._localPlayer.setCachedUrls(urls); + if (this.config.playback.enableCache) { + this._localPlayer.setCachedUrls(urls); + } } public get sessionIdCache(): SessionIdCache | null { diff --git a/src/types/playback-config.ts b/src/types/playback-config.ts index 114ec2107..0e3576e29 100644 --- a/src/types/playback-config.ts +++ b/src/types/playback-config.ts @@ -3,4 +3,5 @@ import { PKPlaybackConfigObject } from '@playkit-js/playkit-js'; export interface PlaybackConfig extends PKPlaybackConfigObject { autopause: boolean; loop: boolean; + enableCache: boolean; } From f10da79ed5e51c7ef78d36be7a6ae435626ee4bc Mon Sep 17 00:00:00 2001 From: SivanA-Kaltura <88330203+SivanA-Kaltura@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:39:14 +0300 Subject: [PATCH 2/2] rename to enableCachedUrls --- src/kaltura-player.ts | 2 +- src/types/playback-config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kaltura-player.ts b/src/kaltura-player.ts index 2a736e08d..d339bdfab 100644 --- a/src/kaltura-player.ts +++ b/src/kaltura-player.ts @@ -1174,7 +1174,7 @@ export class KalturaPlayer extends FakeEventTarget { } public setCachedUrls(urls: string[]): void { - if (this.config.playback.enableCache) { + if (this.config.playback.enableCachedUrls) { this._localPlayer.setCachedUrls(urls); } } diff --git a/src/types/playback-config.ts b/src/types/playback-config.ts index 0e3576e29..73a1d448b 100644 --- a/src/types/playback-config.ts +++ b/src/types/playback-config.ts @@ -3,5 +3,5 @@ import { PKPlaybackConfigObject } from '@playkit-js/playkit-js'; export interface PlaybackConfig extends PKPlaybackConfigObject { autopause: boolean; loop: boolean; - enableCache: boolean; + enableCachedUrls: boolean; }