Skip to content

Commit

Permalink
Refine MediaKeys polyfill error type
Browse files Browse the repository at this point in the history
Inspired by code in pull #176

Change-Id: I2e29310c8a3583ed208d7bd1ae2e747a92ddf480
  • Loading branch information
joeyparrish committed Oct 20, 2015
1 parent 5637962 commit ff1dcc2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/polyfill/patchedmediakeys_v01b.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,14 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeySystemAccess =
}
} // for each cfg in supportedConfigurations

throw Error('None of the requested configurations were supported.');
var message = 'Unsupported keySystem';
if (keySystem == 'org.w3.clearkey' || keySystem == 'com.widevine.alpha') {
message = 'None of the requested configurations were supported.';
}
var unsupportedError = new Error(message);
unsupportedError.name = 'NotSupportedError';
unsupportedError.code = DOMException.NOT_SUPPORTED_ERR;
throw unsupportedError;
};


Expand Down

0 comments on commit ff1dcc2

Please sign in to comment.