Skip to content

Commit

Permalink
fix(FEC-10590): DOM play error on SmartTV on when stall happen on the…
Browse files Browse the repository at this point in the history
… beginning (#123)

Issue: stall skip 0 cause play/pause reject the play promise.
Solution: change to 0 after play promise fulfilled.
  • Loading branch information
Yuvalke committed Nov 24, 2020
1 parent 998d475 commit 84d10f2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/dash-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,28 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
//Need to call this again cause we are uninstalling the VTTCue polyfill to avoid collisions with other libs
shaka.polyfill.installAll();
this._shaka = new shaka.Player();
this._maybeFixStallForSmartTV();
this._maybeSetFilters();
this._maybeSetDrmConfig();
this._shaka.configure(this._config.shakaConfig);
this._addBindings();
}

/**
* fix stall play promise rejected by seeking on the beginning instead of play pause
* @returns {void}
* @private
*/
_maybeFixStallForSmartTV(): void {
const defaultStallSkip = 0.1;
const currentStallSkip = this._shaka.getConfiguration().streaming.stallSkip;
Utils.Object.mergeDeep(this._config.shakaConfig, {streaming: {stallSkip: defaultStallSkip}});
this._eventManager.listenOnce(this._videoElement, EventType.PLAYING, () => {
if (currentStallSkip !== this._shaka.getConfiguration().streaming.stallSkip) {
this._shaka.configure({streaming: {stallSkip: currentStallSkip}});
}
});
}
/**
* get the redirected URL
* @param {string} url - The url to check for redirection
Expand Down

0 comments on commit 84d10f2

Please sign in to comment.