799967501@qq.com

接口添加回放地址返回

... ... @@ -271,18 +271,22 @@ router.post('/fileExists', async function (req, res, next) {
const timeFiles = fs.readdirSync(timeDir)
let classIdStr = `${body.classId}.mp4`
let isFile = false
let fileTime = ""
for(let i=0;i<timeFiles.length;i++){
let classDir = `${timeDir}/${timeFiles[i]}`
const classFiles = fs.readdirSync(classDir)
if(classFiles.indexOf(classIdStr) > -1){
fileTime = timeFiles[i]
isFile = true
break
}
}
if(isFile){
res.send({ code: 0,message:"文件已生成" });
let classUrl = `https://xdymp4.xuedianyun.com/oss/${body.siteId}/${fileTime}/${body.classId}.mp4`
res.send({ code: 0,message:"文件已生成",classUrl });
}else {
res.send({ code: 1,message:"文件未生成" });
let classUrl = `https://pclive.xuedianyun.com/pcBase/pclive2/release/index.html?portalIP=saas.xuedianyun.com&portalPort=80&classId=${body.classId}&channels=2&playRecord=1#/`
res.send({ code: 1,message:"文件未生成",classUrl });
}
})
... ...