Skip to content

Commit

Permalink
feat(FEC-9175): cast content coming from external sources (#17)
Browse files Browse the repository at this point in the history
call `setMedia` when `mediaConfig` configured
  • Loading branch information
yairans committed Dec 3, 2019
1 parent 2a8eb03 commit 8667bbf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/receiver-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,18 @@ class ReceiverManager {
this._reset();
return new Promise((resovle, reject) => {
const mediaInfo = loadRequestData.media.customData.mediaInfo;
const mediaConfig = loadRequestData.media.customData.mediaConfig;
this._maybeCreateVmapAdsRequest(loadRequestData.media);
this._maybeReplaceAdTagTimestamp(loadRequestData.media);
this._eventManager.listen(this._player, this._player.Event.ERROR, event => reject(event));
this._eventManager.listen(this._player, this._player.Event.SOURCE_SELECTED, event => this._onSourceSelected(event, loadRequestData, resovle));
this._player.loadMedia(mediaInfo);
if (mediaInfo) {
this._logger.debug('loadMedia', mediaInfo);
this._player.loadMedia(mediaInfo);
} else {
this._logger.debug('setMedia', mediaConfig);
this._player.setMedia(mediaConfig);
}
});
}

Expand Down

0 comments on commit 8667bbf

Please sign in to comment.