From 1b3367fcf9f1cb1f7e762f3ffdb292ee095136b2 Mon Sep 17 00:00:00 2001 From: milad Date: Fri, 1 Nov 2019 10:51:23 -0700 Subject: [PATCH] logging ids --- .../ScreenshareScriptingInterface.cpp | 32 +++++++++---------- .../scripting/ScreenshareScriptingInterface.h | 2 +- screenshare/src/app.js | 10 ++++-- screenshare/src/main.js | 5 ++- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/interface/src/scripting/ScreenshareScriptingInterface.cpp b/interface/src/scripting/ScreenshareScriptingInterface.cpp index b4793067c5..25a167d2b7 100644 --- a/interface/src/scripting/ScreenshareScriptingInterface.cpp +++ b/interface/src/scripting/ScreenshareScriptingInterface.cpp @@ -9,12 +9,14 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include "ScreenshareScriptingInterface.h" -#include -#include -#include #include +#include +#include +#include +#include + +#include "ScreenshareScriptingInterface.h" ScreenshareScriptingInterface::ScreenshareScriptingInterface() { }; @@ -23,16 +25,11 @@ ScreenshareScriptingInterface::~ScreenshareScriptingInterface() { stopScreenshare(); } -void ScreenshareScriptingInterface::startScreenshare(QString displayName, QString userName, QString token, QString sessionID, QString apiKey) { +void ScreenshareScriptingInterface::startScreenshare(const QString& roomName) { if (QThread::currentThread() != thread()) { // We must start a new QProcess from the main thread. QMetaObject::invokeMethod( - this, "startScreenshare", - Q_ARG(QString, displayName), - Q_ARG(QString, userName), - Q_ARG(QString, token), - Q_ARG(QString, sessionID), - Q_ARG(QString, apiKey) + this, "startScreenshare" ); return; } @@ -50,14 +47,15 @@ void ScreenshareScriptingInterface::startScreenshare(QString displayName, QStrin return; } - if (displayName.isEmpty() || userName.isEmpty() || token.isEmpty() || sessionID.isEmpty() || apiKey.isEmpty()) { - qDebug() << "Screenshare executable can't launch without connection info."; - return; - } + QUuid currentDomainID = DependencyManager::get()->getDomainID(); + + // Make HTTP GET request to: + // `https://metaverse.highfidelity.com/api/v1/domain/:domain_id/screenshare`, + // passing the Domain ID that the user is connected to, as well as the `roomName`. + // The server will respond with the relevant OpenTok Token, Session ID, and API Key. + // Upon error-free response, do the logic below, passing in that info as necessary. QStringList arguments; - arguments << "--userName=" + userName; - arguments << "--displayName=" + displayName; arguments << "--token=" + token; arguments << "--apiKey=" + apiKey; arguments << "--sessionID=" + sessionID; diff --git a/interface/src/scripting/ScreenshareScriptingInterface.h b/interface/src/scripting/ScreenshareScriptingInterface.h index 76aef27826..9cbb1bbdb3 100644 --- a/interface/src/scripting/ScreenshareScriptingInterface.h +++ b/interface/src/scripting/ScreenshareScriptingInterface.h @@ -14,7 +14,7 @@ public: ScreenshareScriptingInterface(); ~ScreenshareScriptingInterface(); - Q_INVOKABLE void startScreenshare(QString displayName, QString userName, QString token, QString sessionID, QString apiKey); + Q_INVOKABLE void startScreenshare(const QString& roomName); Q_INVOKABLE void stopScreenshare(); signals: diff --git a/screenshare/src/app.js b/screenshare/src/app.js index d724e2baf1..a3e4f88e70 100644 --- a/screenshare/src/app.js +++ b/screenshare/src/app.js @@ -117,8 +117,12 @@ function togglePage(){ } for (let source of sources) { + console.log(JSON.stringify(sources,null,4)); sourceMap[source.id] = source; - addSource(source, "selects"); + //*if (source.id.indexOf("screen") > -1) { + // console.log("Adding:", source.id) + addSource(source, "selects"); + //} } }); } @@ -200,7 +204,7 @@ function togglePage(){ var publisherOptions = { videoSource: stream.getVideoTracks()[0], - audioSource: stream.getAudioTracks()[0], + audioSource: null, insertMode: 'append', width: 1280, height: 720 @@ -268,4 +272,4 @@ function togglePage(){ document.addEventListener("DOMContentLoaded", () => { startup(); showSources(); - }) \ No newline at end of file + }) diff --git a/screenshare/src/main.js b/screenshare/src/main.js index c8f7484169..289a4c0ae3 100644 --- a/screenshare/src/main.js +++ b/screenshare/src/main.js @@ -33,11 +33,10 @@ function createWindow(){ useContentSize: true, zoomFactor: zoomFactor, resizable: false, - alwaysOnTop: true, // TRY + alwaysOnTop: false, // TRY webPreferences: { nodeIntegration: true - }, - devTools: true + } }); window.loadURL('file://' + __dirname + '/index.html'); window.setMenu(null);