stormcloud-video-player 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +36 -8
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +36 -8
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +12 -4
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +12 -4
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +12 -4
- package/lib/players/index.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +12 -4
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/tracking.cjs +12 -4
- package/lib/utils/tracking.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -700,10 +700,18 @@ async function getBrowserID(clientInfo) {
|
|
|
700
700
|
if (typeof crypto !== "undefined" && crypto.subtle && crypto.subtle.digest) {
|
|
701
701
|
try {
|
|
702
702
|
await crypto.subtle.digest("SHA-256", new Uint8Array([1, 2, 3]));
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
new TextEncoder().encode(fingerprintString)
|
|
706
|
-
|
|
703
|
+
let encodedData;
|
|
704
|
+
if (typeof TextEncoder !== "undefined") {
|
|
705
|
+
encodedData = new TextEncoder().encode(fingerprintString);
|
|
706
|
+
} else {
|
|
707
|
+
const utf8 = unescape(encodeURIComponent(fingerprintString));
|
|
708
|
+
const buffer = new Uint8Array(utf8.length);
|
|
709
|
+
for (let i = 0; i < utf8.length; i++) {
|
|
710
|
+
buffer[i] = utf8.charCodeAt(i);
|
|
711
|
+
}
|
|
712
|
+
encodedData = buffer;
|
|
713
|
+
}
|
|
714
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", encodedData);
|
|
707
715
|
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
708
716
|
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
709
717
|
cachedBrowserId = hashHex;
|