@livepeer/core-web
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -976,3 +976,2 @@ // src/media/controls/controller.ts | ||
}) => ({ | ||
accessKey: __initialProps.accessKey, | ||
aspectRatio: __initialProps.aspectRatio, | ||
@@ -982,4 +981,2 @@ autoPlay: __initialProps.autoPlay, | ||
hlsConfig: __controls.hlsConfig, | ||
jwt: __initialProps.jwt, | ||
live, | ||
mounted, | ||
@@ -992,3 +989,2 @@ progress, | ||
async ({ | ||
accessKey, | ||
aspectRatio, | ||
@@ -998,4 +994,2 @@ autoPlay, | ||
hlsConfig, | ||
jwt, | ||
live, | ||
mounted, | ||
@@ -1021,2 +1015,3 @@ progress, | ||
const jumpToPreviousPosition = () => { | ||
const live = store.getState().live; | ||
if (!live && progress && !jumped) { | ||
@@ -1054,4 +1049,4 @@ element.currentTime = progress; | ||
accessControl: { | ||
jwt, | ||
accessKey | ||
jwt: store.getState().__initialProps.jwt, | ||
accessKey: store.getState().__initialProps.accessKey | ||
}, | ||
@@ -1078,3 +1073,3 @@ sdpTimeout: timeout | ||
if (source.type === "hls") { | ||
const indexUrl = /^https?:\/\/[^/\s]+\/hls\/[^/\s]+\/index\.m3u8/g; | ||
const indexUrl = /\/hls\/[^/\s]+\/index\.m3u8/; | ||
const onErrorCleaned = (error) => { | ||
@@ -1098,2 +1093,3 @@ const cleanError = new Error( | ||
jumpToPreviousPosition(); | ||
store.getState().__controlsFunctions.onError(null); | ||
}, | ||
@@ -1107,8 +1103,14 @@ onError: onErrorCleaned, | ||
async xhrSetup(xhr, url) { | ||
await hlsConfigResolved?.xhrSetup?.(xhr, url); | ||
if (url.match(indexUrl)) { | ||
if (accessKey) | ||
xhr.setRequestHeader("Livepeer-Access-Key", accessKey); | ||
else if (jwt) | ||
xhr.setRequestHeader("Livepeer-Jwt", jwt); | ||
if (hlsConfigResolved?.xhrSetup) { | ||
await hlsConfigResolved?.xhrSetup?.(xhr, url); | ||
} else { | ||
const live = store.getState().live; | ||
if (!live || url.match(indexUrl)) { | ||
const jwt = store.getState().__initialProps.jwt; | ||
const accessKey = store.getState().__initialProps.accessKey; | ||
if (accessKey) | ||
xhr.setRequestHeader("Livepeer-Access-Key", accessKey); | ||
else if (jwt) | ||
xhr.setRequestHeader("Livepeer-Jwt", jwt); | ||
} | ||
} | ||
@@ -1115,0 +1117,0 @@ }, |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"type": "module", | ||
@@ -86,3 +86,3 @@ "repository": { | ||
"zustand": "^4.5.0", | ||
"@livepeer/core": "3.1.2" | ||
"@livepeer/core": "3.1.3" | ||
}, | ||
@@ -89,0 +89,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
728905
6538
+ Added@livepeer/core@3.1.3(transitive)
- Removed@livepeer/core@3.1.2(transitive)
Updated@livepeer/core@3.1.3