mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
Always use base64url encoding.
This fixes clearkey errors on newer versions of Chrome 42. Change-Id: I3c0d7336fa21587fe730c747e8aea92657a6cf33
This commit is contained in:
committed by
Gerrit Code Review
parent
50de57efad
commit
598e042b4a
@@ -55,7 +55,8 @@ shaka.util.Uint8ArrayUtils.fromString = function(str) {
|
||||
|
||||
|
||||
/**
|
||||
* Convert a Uint8Array to a base-64 string.
|
||||
* Convert a Uint8Array to a base64 string. The output will always use the
|
||||
* alternate encoding/alphabet also known as "base64url".
|
||||
* @param {!Uint8Array} arr
|
||||
* @param {boolean=} opt_padding If true, pad the output with equals signs.
|
||||
* Defaults to true.
|
||||
@@ -69,13 +70,15 @@ shaka.util.Uint8ArrayUtils.toBase64 = function(arr, opt_padding) {
|
||||
|
||||
|
||||
/**
|
||||
* Convert a base-64 string to a Uint8Array.
|
||||
* Convert a base64 string to a Uint8Array. Accepts either the standard
|
||||
* alphabet or the alternate "base64url" alphabet.
|
||||
* @param {string} str
|
||||
* @return {!Uint8Array}
|
||||
* @export
|
||||
*/
|
||||
shaka.util.Uint8ArrayUtils.fromBase64 = function(str) {
|
||||
return shaka.util.Uint8ArrayUtils.fromString(window.atob(str));
|
||||
return shaka.util.Uint8ArrayUtils.fromString(
|
||||
shaka.util.StringUtils.fromBase64(str));
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user