Merge b7635504e862b1302af6b062293df9b9547511b8 into e0fda77c56d2e3d0bcfdf14df779d3c56bf0bcd7
This commit is contained in:
commit
23686891ea
@ -25,6 +25,7 @@ EPG (Guide Information) data is stored to `.dizquetv/xmltv.xml`
|
||||
- Subtitle support.
|
||||
- Auto deinterlace any Plex media not marked `"scanType": "progressive"`
|
||||
- Can be configured to completely force Direct play, if you are ready for the caveats.
|
||||
- It's up to you if the channels have a life of their own and act as if they continued playing when you weren't watching them or if you want "on-demand" channels that stop their schedules while not being watched.
|
||||
|
||||
## Limitations
|
||||
|
||||
|
||||
19
index.js
19
index.js
@ -56,10 +56,13 @@ for (let i = 0, l = process.argv.length; i < l; i++) {
|
||||
process.env.PORT = process.argv[i + 1]
|
||||
if ((process.argv[i] === "-d" || process.argv[i] === "--database") && i + 1 !== l)
|
||||
process.env.DATABASE = process.argv[i + 1]
|
||||
if ((process.argv[i] === "-v" || process.argv[i] === "--videoport") && i + 1 !== l)
|
||||
process.env.PORT = process.argv[i + 1]
|
||||
}
|
||||
|
||||
process.env.DATABASE = process.env.DATABASE || path.join(".", ".dizquetv")
|
||||
process.env.PORT = process.env.PORT || 8000
|
||||
process.env.VIDEO_PORT = process.env.VIDEO_PORT || process.env.PORT // Default to serving both on same port
|
||||
|
||||
if (!fs.existsSync(process.env.DATABASE)) {
|
||||
if (fs.existsSync( path.join(".", ".pseudotv") )) {
|
||||
@ -289,10 +292,24 @@ app.use('/api/cache/images', cacheImageService.apiRouters())
|
||||
app.use('/' + fontAwesome, express.static(path.join(process.env.DATABASE, fontAwesome)))
|
||||
app.use('/' + bootstrap, express.static(path.join(process.env.DATABASE, bootstrap)))
|
||||
|
||||
app.use(video.router( channelService, fillerDB, db, programmingService, activeChannelService, programPlayTimeDB ))
|
||||
// TODO: Should the hdhr router be included on the video stream port? I'm not super familiar with its functionality.
|
||||
app.use(hdhr.router)
|
||||
|
||||
// Set up video router on appropriate port
|
||||
if(process.env.PORT == process.env.VIDEO_PORT) {
|
||||
app.use(video.router( channelService, fillerDB, db, programmingService, activeChannelService, programPlayTimeDB ))
|
||||
} else {
|
||||
// 2nd express app to listen on a different port
|
||||
let videoApp = express()
|
||||
videoApp.use(video.router( channelService, fillerDB, db, programmingService, activeChannelService, programPlayTimeDB ))
|
||||
videoApp.listen(port = process.env.VIDEO_PORT, () => {
|
||||
console.log(`Video stream server running on port: http://*:${process.env.VIDEO_PORT}`)
|
||||
})
|
||||
}
|
||||
|
||||
app.listen(process.env.PORT, () => {
|
||||
console.log(`HTTP server running on port: http://*:${process.env.PORT}`)
|
||||
// TODO: Resolve hdhr question from above.
|
||||
let hdhrSettings = db['hdhr-settings'].find()[0]
|
||||
if (hdhrSettings.autoDiscovery === true)
|
||||
hdhr.ssdp.start()
|
||||
|
||||
@ -562,6 +562,9 @@ function makeEntry(channel, x) {
|
||||
episode: x.program.episode,
|
||||
title: x.program.title,
|
||||
}
|
||||
} else if (x.program.type === 'track') {
|
||||
title = x.program.title;
|
||||
// TODO: Add sub data for tracks here for XML writing
|
||||
}
|
||||
}
|
||||
if (typeof(title)==='undefined') {
|
||||
|
||||
13
src/video.js
13
src/video.js
@ -125,7 +125,8 @@ function video( channelService, fillerDB, db, programmingService, activeChannelS
|
||||
})
|
||||
|
||||
let channelNum = parseInt(req.query.channel, 10)
|
||||
let ff = await ffmpeg.spawnConcat(`http://localhost:${process.env.PORT}/playlist?channel=${channelNum}&audioOnly=${audioOnly}&stepNumber={step}`);
|
||||
let ff = await ffmpeg.spawnConcat(`http://localhost:${process.env.VIDEO_PORT}/playlist?channel=${channelNum}&audioOnly=${audioOnly}&stepNumber=${step}`);
|
||||
|
||||
ff.pipe(res, { end: false} );
|
||||
};
|
||||
router.get('/video', async(req, res) => {
|
||||
@ -599,22 +600,22 @@ function video( channelService, fillerDB, db, programmingService, activeChannelS
|
||||
&& (stepNumber == 0)
|
||||
) {
|
||||
//loading screen
|
||||
data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&first=0&session=${sessionId}&audioOnly=${audioOnly}'\n`;
|
||||
data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&first=0&session=${sessionId}&audioOnly=${audioOnly}'\n`;
|
||||
}
|
||||
let remaining = maxStreamsToPlayInARow;
|
||||
if (stepNumber == 0) {
|
||||
data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&first=1&session=${sessionId}&audioOnly=${audioOnly}'\n`
|
||||
data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&first=1&session=${sessionId}&audioOnly=${audioOnly}'\n`
|
||||
|
||||
if (transcodingEnabled && (audioOnly !== true)) {
|
||||
data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&between=1&session=${sessionId}&audioOnly=${audioOnly}'\n`;
|
||||
data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&between=1&session=${sessionId}&audioOnly=${audioOnly}'\n`;
|
||||
}
|
||||
remaining--;
|
||||
}
|
||||
|
||||
for (var i = 0; i < remaining; i++) {
|
||||
data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&session=${sessionId}&audioOnly=${audioOnly}'\n`
|
||||
data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&session=${sessionId}&audioOnly=${audioOnly}'\n`
|
||||
if (transcodingEnabled && (audioOnly !== true) ) {
|
||||
data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&between=1&session=${sessionId}&audioOnly=${audioOnly}'\n`
|
||||
data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&between=1&session=${sessionId}&audioOnly=${audioOnly}'\n`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -98,6 +98,7 @@ async function _writeProgramme(channel, program, xw, xmlSettings, cacheImageServ
|
||||
xw.writeRaw('\n <previously-shown/>')
|
||||
|
||||
//sub-title
|
||||
// TODO: Add support for track data (artist, album) here
|
||||
if ( typeof(program.sub) !== 'undefined') {
|
||||
xw.startElement('sub-title')
|
||||
xw.writeAttribute('lang', 'en')
|
||||
|
||||
@ -312,7 +312,7 @@ module.exports = function ($scope, $timeout, dizquetv) {
|
||||
ch.programs.push( {
|
||||
duration: addDuration(b - a),
|
||||
altTitle: altTitle,
|
||||
showTitle: program.title,
|
||||
showTitle: program.title, // movie title, episode title or track title
|
||||
subTitle: subTitle,
|
||||
episodeTitle : episodeTitle,
|
||||
start: hasStart,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user