Skip to content

Commit

Permalink
fix(FEC-10749): playlist by sources stuck (#386)
Browse files Browse the repository at this point in the history
Issue: #370 [moved](https://github.com/kaltura/kaltura-player-js/pull/370/files#diff-b20fda8cac0288af75e0f3c4304df5420584de585d923934f9606e3634d2dbf5L302) the redirect default settings from `setup` to `loadMedia`
so `sources` could be `undefined` in kaltura-player constructor  
Solution: pass empty object to `sources` to the local player if it's `undefined`

Solves FEC-10749
  • Loading branch information
yairans authored Dec 6, 2020
1 parent c50a66c commit a747f70
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/kaltura-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class KalturaPlayer extends FakeEventTarget {
Object.values(CoreEventType).forEach(coreEvent => this._eventManager.listen(this._localPlayer, coreEvent, e => this.dispatchEvent(e)));
this._addBindings();
this._playlistManager.configure(options.playlist);
this._localPlayer.configure({sources});
this._localPlayer.configure({sources: sources || {}});
}

/**
Expand Down
13 changes: 13 additions & 0 deletions test/src/kaltura-player.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ describe('kaltura player api', function () {
TestUtils.removeElement(targetId);
});

describe('constructor', function () {
beforeEach(function () {
kalturaPlayer = setup(config);
});

afterEach(function () {
kalturaPlayer.destroy();
});
it('config.sources should be an empty object if no configured', function () {
kalturaPlayer.config.sources.should.be.exist;
});
});
describe('media api', function () {
describe('loadMedia', function () {
const entryId = '0_wifqaipd';
Expand Down Expand Up @@ -614,6 +626,7 @@ describe('kaltura player api', function () {
});
});
});

describe('async plugins loading', () => {
let player;
beforeEach(() => {
Expand Down

0 comments on commit a747f70

Please sign in to comment.