fix pub vids
This commit is contained in:
parent
e3eb2130ba
commit
074e06236a
1 changed files with 7 additions and 0 deletions
7
index.js
7
index.js
|
@ -50,6 +50,9 @@ app.get("/watch/*", (req, res) => {
|
||||||
|
|
||||||
var video = req.params[0]
|
var video = req.params[0]
|
||||||
var absPath = path.join(directory, video)
|
var absPath = path.join(directory, video)
|
||||||
|
if (!fs.existsSync(absPath)) {
|
||||||
|
absPath = path.join(pubDir, video)
|
||||||
|
}
|
||||||
|
|
||||||
var html = fs.readFileSync(path.join(__dirname, 'resources/watch.html')).toString()
|
var html = fs.readFileSync(path.join(__dirname, 'resources/watch.html')).toString()
|
||||||
|
|
||||||
|
@ -72,6 +75,10 @@ app.get("/video/*", (req, res) => {
|
||||||
var video = req.params[0]
|
var video = req.params[0]
|
||||||
var vidPath = path.join(directory, video)
|
var vidPath = path.join(directory, video)
|
||||||
|
|
||||||
|
if (!fs.existsSync(vidPath)) {
|
||||||
|
vidPath = path.join(pubDir, video)
|
||||||
|
}
|
||||||
|
|
||||||
const range = req.headers.range
|
const range = req.headers.range
|
||||||
const videoPath = vidPath;
|
const videoPath = vidPath;
|
||||||
const videoSize = fs.statSync(videoPath).size
|
const videoSize = fs.statSync(videoPath).size
|
||||||
|
|
Loading…
Reference in a new issue