-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(FEC-11136): Tizen 4 got stuck on the beginning of the media #140
Changes from 1 commit
ddf90ed
8a92e05
4be1365
a0d515e
1cd14a6
baa2ec3
81c227f
ffc26fb
68a6b42
451d552
6da4acb
e63f396
61e5387
36d18fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,6 +144,13 @@ export default class DashAdapter extends BaseMediaSourceAdapter { | |
*/ | ||
_videoSizeUpdateTimer: ?IntervalID = null; | ||
|
||
/** | ||
* stall interval to break the stall on Smart TV | ||
* @type {null|number} | ||
* @private | ||
*/ | ||
_stallInterval: ?IntervalID = null; | ||
|
||
/** | ||
* 3016 is the number of the video error at shaka, we already listens to it in the html5 class | ||
* @member {number} - VIDEO_ERROR_CODE | ||
|
@@ -365,10 +372,42 @@ export default class DashAdapter extends BaseMediaSourceAdapter { | |
} | ||
this._maybeSetFilters(); | ||
this._maybeSetDrmConfig(); | ||
this._maybeBreakStalls(); | ||
this._shaka.configure(this._config.shakaConfig); | ||
this._addBindings(); | ||
} | ||
|
||
_clearStallInterval(): void { | ||
if (this._stallInterval) { | ||
clearInterval(this._stallInterval); | ||
this._stallInterval = null; | ||
} | ||
} | ||
|
||
_stallSmartTVHandler(): void { | ||
this._clearStallInterval(); | ||
let lastCurrentTime = this._videoElement.currentTime; | ||
this._stallInterval = setInterval(() => { | ||
if (lastCurrentTime === this._videoElement.currentTime) { | ||
this._videoElement.currentTime = parseFloat(this._videoElement.currentTime.toFixed(1)) + 0.1; | ||
} else { | ||
this._clearStallInterval(); | ||
} | ||
}, 2 * 1000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move to const, maybe expose as config? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't want to do it too robust cause I believe we need to handle it on Shaka, WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To create 3 configs for hack we're adding for edge case that we won't need anymore after Shaka will handle it, it sounds too robust, don't you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree, let's start lean, but please move to consts and we will hope Shaka will approve this :-) |
||
} | ||
|
||
/** | ||
* register to event to break the stalls on smart TV | ||
* @returns {void} | ||
* @private | ||
*/ | ||
_maybeBreakStalls(): void { | ||
if (this._config.playback.forceBreakStall) { | ||
this._eventManager.listenOnce(EventType.STALLED, this._stallSmartTVHandler); | ||
this._eventManager.listenOnce(EventType.SEEKED, this._stallSmartTVHandler); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need/want to remove them after one handler is called? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I clear the stall interval if it's not stopped for each one of them. |
||
} | ||
} | ||
|
||
/** | ||
* get the redirected URL | ||
* @param {string} url - The url to check for redirection | ||
|
@@ -729,6 +768,7 @@ export default class DashAdapter extends BaseMediaSourceAdapter { | |
this._responseFilterError = false; | ||
this._manifestParser = null; | ||
this._thumbnailController = null; | ||
this._clearStallInterval(); | ||
this._clearVideoUpdateTimer(); | ||
if (this._eventManager) { | ||
this._eventManager.removeAll(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move 0.1 to const, maybe expose as config?