mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 04:13:47 +00:00
feat: implement event timer
This commit is contained in:
@@ -47,13 +47,13 @@ exports.pbRoll = async (req, res) => {
|
||||
// Create controller for GET request to '/playback/previous'
|
||||
// Sets timer object to roll mode
|
||||
exports.pbPrevious = async (req, res) => {
|
||||
console.log('previous: not implemented');
|
||||
res.sendStatus(501);
|
||||
global.timer.previous();
|
||||
res.sendStatus(200);
|
||||
};
|
||||
|
||||
// Create controller for GET request to '/playback/next'
|
||||
// Sets timer object to roll mode
|
||||
exports.pbNext = async (req, res) => {
|
||||
console.log('next: not implemented');
|
||||
res.sendStatus(501);
|
||||
global.timer.next();
|
||||
res.sendStatus(200);
|
||||
};
|
||||
|
||||
@@ -20,11 +20,10 @@ const initiateSocket = (server, config) => {
|
||||
// send current data
|
||||
socket.emit('timer', global.timer.getObject());
|
||||
|
||||
// unsubscribe to timer
|
||||
socket.on('release-timer', () => {
|
||||
console.log('Releasing subscription');
|
||||
// avoid multiple intervals
|
||||
if (interval) clearInterval(interval);
|
||||
socket.on('get-state', () => {
|
||||
socket.emit('timer', global.timer.getObject());
|
||||
socket.emit('playstate', global.timer.playState);
|
||||
socket.emit('selected-id', global.timer.selectedEventId);
|
||||
});
|
||||
|
||||
socket.on('get-timer', () => {
|
||||
@@ -35,6 +34,10 @@ const initiateSocket = (server, config) => {
|
||||
socket.emit('playstate', global.timer.playState);
|
||||
});
|
||||
|
||||
socket.on('get-selected-id', () => {
|
||||
socket.emit('selected-id', global.timer.selectedEventId);
|
||||
});
|
||||
|
||||
// playback API
|
||||
socket.on('set-presenter-text', (data) => {
|
||||
global.timer.presenterText = data;
|
||||
|
||||
Reference in New Issue
Block a user