Skip to content

Commit

Permalink
Add screenshare actions
Browse files Browse the repository at this point in the history
This is a work in progress.

A presenter bot can now start and stop it's screenshare. The media sent
to the server is the same fake media used for the video.

TODO:
 - check if it's a presenter
  • Loading branch information
pedrobmarin committed Dec 5, 2020
1 parent 48c39d5 commit d73fd70
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 25 deletions.
2 changes: 2 additions & 0 deletions config/label/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const chat = require('./chat');
const main = require('./main');
const note = require('./note');
const presentation = require('./presentation');
const screenshare = require('./screenshare');
const user = require('./user');
const video = require('./video');
const whiteboard = require('./whiteboard');
Expand All @@ -13,6 +14,7 @@ module.exports = {
main,
note,
presentation,
screenshare,
user,
video,
whiteboard,
Expand Down
4 changes: 4 additions & 0 deletions config/label/screenshare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
start: 'app.actionsBar.actionsDropdown.desktopShareLabel',
stop: 'app.actionsBar.actionsDropdown.stopDesktopShareLabel',
};
50 changes: 25 additions & 25 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
/**
* @name Index
*
* @desc BigBlueBot API
*/
require('dotenv').config();

require('dotenv').config()
const action = require('./lib/action');

const audio = require('./lib/action/audio.js')
const chat = require('./lib/action/chat.js')
const note = require('./lib/action/note.js')
const presentation = require('./lib/action/presentation.js')
const user = require('./lib/action/user.js')
const video = require('./lib/action/video.js')
const whiteboard = require('./lib/action/whiteboard.js')
const {
audio,
chat,
note,
presentation,
screenshare,
user,
video,
whiteboard,
} = action;

const logger = require('./lib/logger.js')
const run = require('./lib/run.js')
const logger = require('./lib/logger');
const run = require('./lib/run');

module.exports = {
audio: audio,
chat: chat,
note: note,
presentation: presentation,
user: user,
video: video,
whiteboard: whiteboard,
logger: logger,
run: run
}
audio,
chat,
note,
presentation,
screenshare,
user,
video,
whiteboard,
logger,
run,
};
2 changes: 2 additions & 0 deletions lib/action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const audio = require('./audio');
const chat = require('./chat');
const note = require('./note');
const presentation = require('./presentation');
const screenshare = require('./screenshare');
const user = require('./user');
const video = require('./video');
const whiteboard = require('./whiteboard');
Expand All @@ -11,6 +12,7 @@ module.exports = {
chat,
note,
presentation,
screenshare,
user,
video,
whiteboard,
Expand Down
29 changes: 29 additions & 0 deletions lib/action/screenshare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const conf = require('../conf');
const util = require('../util');
const perform = require('./perform');
const audio = require('./audio');

const { screenshare: label } = conf.label;

const action = {
get start() {
return {
description: 'screenshare start',
before: audio.modal.close,
execute: async page => await util.click(page, label.start, true),
test: async page => true, // TODO
};
},
get stop() {
return {
description: 'screenshare stop',
execute: async page => await util.click(page, label.stop, true),
test: async page => true, // TODO
};
},
};

module.exports = {
start: async page => await perform(page, action.start),
stop: async page => await perform(page, action.stop),
};

0 comments on commit d73fd70

Please sign in to comment.