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
package/lib/players/index.cjs
CHANGED
|
@@ -739,10 +739,18 @@ async function getBrowserID(clientInfo) {
|
|
|
739
739
|
if (typeof crypto !== "undefined" && crypto.subtle && crypto.subtle.digest) {
|
|
740
740
|
try {
|
|
741
741
|
await crypto.subtle.digest("SHA-256", new Uint8Array([1, 2, 3]));
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
new TextEncoder().encode(fingerprintString)
|
|
745
|
-
|
|
742
|
+
let encodedData;
|
|
743
|
+
if (typeof TextEncoder !== "undefined") {
|
|
744
|
+
encodedData = new TextEncoder().encode(fingerprintString);
|
|
745
|
+
} else {
|
|
746
|
+
const utf8 = unescape(encodeURIComponent(fingerprintString));
|
|
747
|
+
const buffer = new Uint8Array(utf8.length);
|
|
748
|
+
for (let i = 0; i < utf8.length; i++) {
|
|
749
|
+
buffer[i] = utf8.charCodeAt(i);
|
|
750
|
+
}
|
|
751
|
+
encodedData = buffer;
|
|
752
|
+
}
|
|
753
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", encodedData);
|
|
746
754
|
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
747
755
|
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
748
756
|
cachedBrowserId = hashHex;
|