History

logging ids

milad committed 7 years ago

Commit 1b3367f1 parent 240764c4 files · +24 −23Browse files

Showing the changes to interface/src/scripting/ScreenshareScriptingInterface.cpp (1 of 4 files). Show all

Unified · Split

interface/src/scripting/ScreenshareScriptingInterface.cpp+14−16
@@ -9,12 +9,14 @@ · 8 unmodified lines
99 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
1010 //
1111
12−#include "ScreenshareScriptingInterface.h"
13−#include <QThread>
12+#include <QCoreApplication>
1413 #include <QDesktopServices>
14+#include <QThread>
1515 #include <QUrl>
16−#include <QCoreApplication>
1716
17+#include <AddressManager.h>
18+
19+#include "ScreenshareScriptingInterface.h"
1820
1921 ScreenshareScriptingInterface::ScreenshareScriptingInterface() {
2022 };
@@ -23,16 +25,11 @@ ScreenshareScriptingInterface::~ScreenshareScriptingInterface() { · 2 unmodified lines
2325 stopScreenshare();
2426 }
2527
26−void ScreenshareScriptingInterface::startScreenshare(QString displayName, QString userName, QString token, QString sessionID, QString apiKey) {
28+void ScreenshareScriptingInterface::startScreenshare(const QString& roomName) {
2729 if (QThread::currentThread() != thread()) {
2830 // We must start a new QProcess from the main thread.
2931 QMetaObject::invokeMethod(
30− this, "startScreenshare",
31− Q_ARG(QString, displayName),
32− Q_ARG(QString, userName),
33− Q_ARG(QString, token),
34− Q_ARG(QString, sessionID),
35− Q_ARG(QString, apiKey)
32+ this, "startScreenshare"
3633 );
3734 return;
3835 }
@@ -50,14 +47,15 @@ void ScreenshareScriptingInterface::startScreenshare(QString displayName, QStrin · 11 unmodified lines
5047 return;
5148 }
5249
53− if (displayName.isEmpty() || userName.isEmpty() || token.isEmpty() || sessionID.isEmpty() || apiKey.isEmpty()) {
54− qDebug() << "Screenshare executable can't launch without connection info.";
55− return;
56− }
50+ QUuid currentDomainID = DependencyManager::get<AddressManager>()->getDomainID();
51+
52+ // Make HTTP GET request to:
53+ // `https://metaverse.highfidelity.com/api/v1/domain/:domain_id/screenshare`,
54+ // passing the Domain ID that the user is connected to, as well as the `roomName`.
55+ // The server will respond with the relevant OpenTok Token, Session ID, and API Key.
56+ // Upon error-free response, do the logic below, passing in that info as necessary.
5757
5858 QStringList arguments;
59− arguments << "--userName=" + userName;
60− arguments << "--displayName=" + displayName;
6159 arguments << "--token=" + token;
6260 arguments << "--apiKey=" + apiKey;
6361 arguments << "--sessionID=" + sessionID;