Skip to content

Commit

Permalink
dont call setCachedUrls if its not set
Browse files Browse the repository at this point in the history
  • Loading branch information
SivanA-Kaltura committed Jul 22, 2024
1 parent 7adc172 commit 121653c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1918,8 +1918,7 @@ export default class Player extends FakeEventTarget {
this._engine = this._engineDecoratorManager ? (new EngineDecorator(engine, this._engineDecoratorManager) as EngineDecoratorType) : engine;

if (this._cachedUrls.length) {
this._engine.setCachedUrls(this._cachedUrls);
this._cachedUrls = [];
this.setCachedUrls(this._cachedUrls);
}
}

Expand Down Expand Up @@ -2881,7 +2880,7 @@ export default class Player extends FakeEventTarget {
public setCachedUrls(cachedUrls: string[]): void {
this._cachedUrls = cachedUrls;

if (this._engine) {
if (this._engine && this._engine.setCachedUrls) {
this._engine.setCachedUrls(cachedUrls);
this._cachedUrls = [];
}
Expand Down

0 comments on commit 121653c

Please sign in to comment.