Commit d8518943 authored by Tom Jorquera's avatar Tom Jorquera
Browse files

Initial version of hublot

parent 52edec22
const config = require('./config.json');
const webdriverio = require('webdriverio');
const fs = require('fs');
const runner = require('./lib/runner.js')(config.runner);
fs.readFile('robotClientController.js', 'utf8', (err,data) => {
if (err) {
console.error(err);
return;
}
let client = runner.run(data, config.visio.url, 'test-bot');
});
{
"visio": {
"url": "http://hubl.in"
},
"runner": {
"name": "hublot",
"driver" : {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args" : [
"--disable-web-security",
"--use-fake-device-for-media-stream",
"--use-fake-ui-for-media-stream"
]
}
}
}
}
}
let webdriverio = require('webdriverio');
module.exports = (config) => ({
run: (controller, server, room) => {
let client = webdriverio.remote(config.driver);
client.init()
.url(server + '/' + room)
.execute(controller, room, config.name) // injecting our controller
.waitForVisible('#displayname', 30000)
.setValue('#displayname', config.name)
.click('.btn')
.waitForExist('//div[@video-id="video-thumb8"]', 30000);
return client;
}
});
{
"name": "hublot",
"version": "0.0.1",
"main": "index.js",
"dependencies":{
"webdriverio": "4.7.1"
},
"author": "Tom Jorquera",
"license": "AGPLv3"
}
var room = arguments[0];
var name = arguments[1];
controller = {
$scope: angular.element(document.body).scope().$root,
chatService: angular.element(document.body).injector().get('chat'),
getParticipants: () => {
return easyrtc.getRoomOccupantsAsArray(room);
},
getRemoteStream: (participant) => {
return easyrtc.getRemoteStream(participant);
},
getRemoteStreams: () => {
let participants = controller.getParticipants();
let res = {};
for(let i = 0; i < participants.length; i++){
let participant = participants[i];
try{
let mediaStream = controller.getRemoteStream(participant);
if(mediaStream !== null){
res[participant] = mediaStream;
}
} catch (e){
console.error('could not get remote stream for %s', participant);
console.error(e);
}
}
return res;
}
};
controller.$scope.$on('conferencestate:attendees:push', function(event, data) {
console.log('### someone connected %j %j', event, data);
console.log('RemoteMediaStream %j', controller.getRemoteStream(data.easyrtcid));
controller.chatService.sendMessage({author: name, displayName: name, message: 'Hello!'});
});
controller.$scope.$on('conferencestate:attendees:remove', function(event, data) {
console.log('### someone leaved %j %j', event, data);
controller.chatService.sendMessage({author: name, displayName: name, message: 'Goodbye!'});
});
controller.$scope.$on('attendee:update', function(event, data){
console.log('### received update %j %j', event, data);
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment