Skip to content

Commit 8df5545

Browse files
committed
Simplified mediaTypes changing logic.
1 parent d51c7ac commit 8df5545

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lib/drm/drm_engine.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -809,15 +809,9 @@ shaka.drm.DrmEngine = class {
809809
* @param {!shaka.extern.DrmInfo} drmInfo
810810
*/
811811
updateCurrentDrmInfo(drmInfo) {
812-
if (this.currentDrmInfo_) {
813-
const mediaTypesEmpty =
814-
!this.currentDrmInfo_.mediaTypes && drmInfo.mediaTypes;
815-
const mediaTypesChanged =
816-
this.currentDrmInfo_.mediaTypes &&
817-
this.currentDrmInfo_.mediaTypes !== drmInfo.mediaTypes;
818-
if (mediaTypesEmpty || mediaTypesChanged) {
819-
this.currentDrmInfo_.mediaTypes = drmInfo.mediaTypes;
820-
}
812+
if (this.currentDrmInfo_ &&
813+
(this.currentDrmInfo_.mediaTypes !== drmInfo.mediaTypes)) {
814+
this.currentDrmInfo_.mediaTypes = drmInfo.mediaTypes;
821815
}
822816
}
823817

0 commit comments

Comments
 (0)