Skip to content

Commit

Permalink
Fix 3490 (#3506)
Browse files Browse the repository at this point in the history
* Clean mediaInfo array in ProtectionController.js and trigger request for key system access only if init data has changed.

* Terminate key selection for existing key systems and no init data

* Remove unnecessary parameter in initializeForMedia call

* Further refactoring and simplification of ProtectionController.js
  • Loading branch information
dsilhavy authored Jan 13, 2021
1 parent bddaf1d commit 072fbb4
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 132 deletions.
8 changes: 5 additions & 3 deletions src/streaming/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,12 @@ function Stream(config) {
if (protectionController) {
// Need to check if streamProcessors exists because streamProcessors
// could be cleared in case an error is detected while initializing DRM keysystem
protectionController.clearMediaInfoArrayByStreamId(getId());
for (let i = 0; i < ln && streamProcessors[i]; i++) {
if (streamProcessors[i].getType() === Constants.AUDIO ||
streamProcessors[i].getType() === Constants.VIDEO ||
streamProcessors[i].getType() === Constants.FRAGMENTED_TEXT) {
const type = streamProcessors[i].getType();
if (type === Constants.AUDIO ||
type === Constants.VIDEO ||
type === Constants.FRAGMENTED_TEXT) {
let mediaInfo = streamProcessors[i].getMediaInfo();
if (mediaInfo) {
protectionController.initializeForMedia(mediaInfo);
Expand Down
Loading

0 comments on commit 072fbb4

Please sign in to comment.