Update HLS stream endpoints to not include user token

This commit is contained in:
advplyr 2025-05-06 17:28:19 -05:00
parent 1afb8840db
commit 1f7b181b7b
3 changed files with 4 additions and 7 deletions

View File

@ -1,5 +1,5 @@
export default class AudioTrack { export default class AudioTrack {
constructor(track, sessionId, userToken, routerBasePath) { constructor(track, sessionId, routerBasePath) {
this.index = track.index || 0 this.index = track.index || 0
this.startOffset = track.startOffset || 0 // Total time of all previous tracks this.startOffset = track.startOffset || 0 // Total time of all previous tracks
this.duration = track.duration || 0 this.duration = track.duration || 0
@ -11,7 +11,7 @@ export default class AudioTrack {
this.sessionId = sessionId this.sessionId = sessionId
this.routerBasePath = routerBasePath || '' this.routerBasePath = routerBasePath || ''
if (this.contentUrl?.startsWith('/hls')) { if (this.contentUrl?.startsWith('/hls')) {
this.sessionTrackUrl = `${this.contentUrl}?token=${userToken}` this.sessionTrackUrl = this.contentUrl
} else { } else {
this.sessionTrackUrl = `/public/session/${sessionId}/track/${this.index}` this.sessionTrackUrl = `/public/session/${sessionId}/track/${this.index}`
} }

View File

@ -37,9 +37,6 @@ export default class PlayerHandler {
get isPlayingLocalItem() { get isPlayingLocalItem() {
return this.libraryItem && this.player instanceof LocalAudioPlayer return this.libraryItem && this.player instanceof LocalAudioPlayer
} }
get userToken() {
return this.ctx.$store.getters['user/getToken']
}
get playerPlaying() { get playerPlaying() {
return this.playerState === 'PLAYING' return this.playerState === 'PLAYING'
} }
@ -226,7 +223,7 @@ export default class PlayerHandler {
console.log('[PlayerHandler] Preparing Session', session) console.log('[PlayerHandler] Preparing Session', session)
var audioTracks = session.audioTracks.map((at) => new AudioTrack(at, session.id, this.userToken, this.ctx.$config.routerBasePath)) var audioTracks = session.audioTracks.map((at) => new AudioTrack(at, session.id, this.ctx.$config.routerBasePath))
this.ctx.playerLoading = true this.ctx.playerLoading = true
this.isHlsTranscode = true this.isHlsTranscode = true

View File

@ -313,7 +313,7 @@ class Server {
router.use(express.json({ limit: '5mb' })) router.use(express.json({ limit: '5mb' }))
router.use('/api', this.auth.ifAuthNeeded(this.authMiddleware.bind(this)), this.apiRouter.router) router.use('/api', this.auth.ifAuthNeeded(this.authMiddleware.bind(this)), this.apiRouter.router)
router.use('/hls', this.authMiddleware.bind(this), this.hlsRouter.router) router.use('/hls', this.hlsRouter.router)
router.use('/public', this.publicRouter.router) router.use('/public', this.publicRouter.router)
// Static path to generated nuxt // Static path to generated nuxt