fix(1748): changed sending token from cookie to url param in player (#515)
parent
6bd436b80b
commit
59aa0063dd
@ -1,10 +1,13 @@ |
|||||||
import Hls from 'hls.js' |
import Hls from 'hls.js' |
||||||
|
|
||||||
|
import { readToken } from 'helpers/token' |
||||||
|
|
||||||
export const streamConfig: Partial<Hls.Config> = { |
export const streamConfig: Partial<Hls.Config> = { |
||||||
liveSyncDuration: 10, |
liveSyncDuration: 10, |
||||||
maxBufferLength: 15, |
maxBufferLength: 15, |
||||||
xhrSetup: (xhr) => { |
xhrSetup: (xhr, urlString) => { |
||||||
// eslint-disable-next-line no-param-reassign
|
const url = new URL(urlString) |
||||||
xhr.withCredentials = true |
url.searchParams.set('access_token', readToken() || '') |
||||||
|
xhr.open('GET', url.toString()) |
||||||
}, |
}, |
||||||
} |
} |
||||||
|
|||||||
Loading…
Reference in new issue