mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-25 10:19:04 +02:00
Adding audio playback speed control, updating volume control UI, fix stream play for small streams
This commit is contained in:
parent
4bcb346365
commit
be7e2576f1
13 changed files with 192 additions and 211 deletions
|
@ -28,14 +28,11 @@ class HlsController {
|
|||
|
||||
async streamFileRequest(req, res) {
|
||||
var streamId = req.params.stream
|
||||
|
||||
// Logger.info('Got hls request', streamId, req.params.file)
|
||||
|
||||
var fullFilePath = Path.join(this.MetadataPath, streamId, req.params.file)
|
||||
|
||||
var exists = await fs.pathExists(fullFilePath)
|
||||
if (!exists) {
|
||||
Logger.error('File path does not exist', fullFilePath)
|
||||
Logger.warn('File path does not exist', fullFilePath)
|
||||
|
||||
var fileExt = Path.extname(req.params.file)
|
||||
if (fileExt === '.ts') {
|
||||
|
@ -52,36 +49,16 @@ class HlsController {
|
|||
} else {
|
||||
var startTimeForReset = await stream.checkSegmentNumberRequest(segNum)
|
||||
if (startTimeForReset) {
|
||||
// HLS.js should request the file again]
|
||||
// HLS.js will restart the stream at the new time
|
||||
Logger.info(`[HLS-CONTROLLER] Resetting Stream - notify client @${startTimeForReset}s`)
|
||||
this.emitter('stream_reset', {
|
||||
startTime: startTimeForReset,
|
||||
streamId: stream.id
|
||||
})
|
||||
return res.sendStatus(500)
|
||||
// await new Promise((resolve) => {
|
||||
// setTimeout(() => {
|
||||
// console.log('Waited 4 seconds')
|
||||
// resolve()
|
||||
// }, 4000)
|
||||
// })
|
||||
|
||||
// exists = await fs.pathExists(fullFilePath)
|
||||
// if (!exists) {
|
||||
// console.error('Still does not exist')
|
||||
// return res.sendStatus(404)
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// await new Promise(resolve => setTimeout(resolve, 500))
|
||||
// exists = await fs.pathExists(fullFilePath)
|
||||
// Logger.info('Waited', exists)
|
||||
// if (!exists) {
|
||||
// Logger.error('still does not exist', fullFilePath)
|
||||
// return res.sendStatus(404)
|
||||
// }
|
||||
}
|
||||
// Logger.info('Sending file', fullFilePath)
|
||||
res.sendFile(fullFilePath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue