Skip to content

Commit

Permalink
fix(SUP-40595):New player version (#741)
Browse files Browse the repository at this point in the history
* fix(SUP-40595):New player version
  • Loading branch information
inbalvasserman authored Dec 20, 2023
1 parent 3947c49 commit 136d2ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/engines/html5/media-source/adapters/native-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ export default class NativeAdapter extends BaseMediaSourceAdapter {
* @private
*/
_captionsHidden: boolean = false;
/**
* sources for adapter
* @type {HTMLElement}
* @private
*/
_sourceElement = null;
/**
* Checks if NativeAdapter can play a given mime type.
* @function canPlayType
Expand Down Expand Up @@ -443,9 +449,8 @@ export default class NativeAdapter extends BaseMediaSourceAdapter {
*/
detachMediaSource(): void {
this._lastTimeDetach = this._videoElement.currentTime;
if (this._videoElement && this._videoElement.src) {
Utils.Dom.setAttribute(this._videoElement, 'src', '');
Utils.Dom.removeAttribute(this._videoElement, 'src');
if (this._sourceElement) {
this._videoElement.removeChild(this._sourceElement);
}
this._loadPromise = null;
}
Expand Down Expand Up @@ -497,6 +502,7 @@ export default class NativeAdapter extends BaseMediaSourceAdapter {
source.setAttribute('type', mimetype + ';mediaOption=' + mediaOption);
}
this._videoElement.appendChild(source);
this._sourceElement = source;
} else {
this._videoElement.src = updatedRequest.url;
}
Expand Down

0 comments on commit 136d2ee

Please sign in to comment.