Skip to content

Commit

Permalink
fix(FEC-7476): error handling (#63)
Browse files Browse the repository at this point in the history
handling providers error in the promise.
  • Loading branch information
odedhutzler committed Dec 6, 2017
1 parent 8902116 commit b2cdc1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kaltura-player.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import {Utils} from 'playkit-js'
import {Utils, Error, FakeEvent} from 'playkit-js'
import PlaykitUI from 'playkit-js-ui'
import OvpProvider from 'playkit-js-providers/dist/ovpProvider'
import getLogger from './utils/logger'
Expand Down Expand Up @@ -29,6 +29,7 @@ export default class KalturaPlayer {

loadMedia(entryId: string, uiConfId: ?number): Promise<*> {
this._logger.debug('loadMedia', {entryId: entryId, uiConfId: uiConfId});
this._uiManager.setConfig({entryId: entryId}, "errorOverlay");
return this._provider.getConfig(entryId, uiConfId)
.then((data) => {
const dimensions = this._player.dimensions;
Expand All @@ -40,6 +41,8 @@ export default class KalturaPlayer {
this._uiManager.setSessionId(data.session.id);
evaluatePluginsConfig(data);
this._player.configure(data);
}).catch(e => {
this._player.dispatchEvent(new FakeEvent(this._player.Event.ERROR, new Error(Error.Severity.CRITICAL, Error.Category.PLAYER, Error.Code.LOAD_FAILED, e)));
});
}
}

0 comments on commit b2cdc1b

Please sign in to comment.