Showing the changes to interface/src/scripting/ScreenshareScriptingInterface.cpp (1 of 3 files). Show all
Unified · Split
| @@ -40,12 +40,14 @@ ScreenshareScriptingInterface::~ScreenshareScriptingInterface() { · 39 unmodified lines | ||
| 40 | 40 | |
| 41 | 41 | static const EntityTypes::EntityType LOCAL_SCREENSHARE_WEB_ENTITY_TYPE = EntityTypes::Web; |
| 42 | 42 | static const uint8_t LOCAL_SCREENSHARE_WEB_ENTITY_FPS = 30; |
| 43 | +// This is going to be a good amount of work to make this work dynamically for any screensize. | |
| 44 | +// V1 will have only hardcoded values. | |
| 43 | 45 | static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION(0.0f, -0.0862f, 0.0711f); |
| 46 | +static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_DIMENSIONS(4.0419f, 2.2735f, 0.0100f); | |
| 44 | 47 | static const QString LOCAL_SCREENSHARE_WEB_ENTITY_URL = |
| 45 | 48 | "https://hifi-content.s3.amazonaws.com/Experiences/Releases/usefulUtilities/smartBoard/screenshareViewer/screenshareClient.html"; |
| 46 | −static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_DIMENSIONS(4.0419f, 2.2735f, 0.0100f); | |
| 47 | 49 | QString token; |
| 48 | −QString apiKey; | |
| 50 | +QString projectAPIKey; | |
| 49 | 51 | QString sessionID; |
| 50 | 52 | void ScreenshareScriptingInterface::startScreenshare(const QUuid& screenshareZoneID, |
| 51 | 53 | const QUuid& smartboardEntityID, |
| @@ -91,15 +93,16 @@ void ScreenshareScriptingInterface::startScreenshare(const QUuid& screenshareZon · 39 unmodified lines | ||
| 91 | 93 | QJsonDocument answerJSONObject = QJsonDocument::fromJson(answerByteArray); |
| 92 | 94 | |
| 93 | 95 | token = answerJSONObject["token"].toString(); |
| 94 | − apiKey = answerJSONObject["apiKey"].toString(); | |
| 95 | − sessionID = answerJSONObject["sessionId"].toString(); // hifi-test has Id camel-case. Change for metaverse. | |
| 96 | − qDebug() << "token:" << token << " apiKey:" << apiKey << " sessionID: " << sessionID; | |
| 96 | + projectAPIKey = answerJSONObject["projectAPIKey"].toString(); | |
| 97 | + sessionID = answerJSONObject["sessionID"].toString(); // hifi-test has Id camel-case. Change for metaverse. | |
| 98 | + qDebug() << "token:" << token << " projectAPIKey:" << projectAPIKey << " sessionID: " << sessionID; | |
| 97 | 99 | |
| 98 | 100 | if (isPresenter) { |
| 99 | 101 | QStringList arguments; |
| 100 | − arguments << "--token=" + token; | |
| 101 | − arguments << "--apiKey=" + apiKey; | |
| 102 | − arguments << "--sessionID=" + sessionID; | |
| 102 | + arguments << " "; | |
| 103 | + arguments << "--token=" + token << " "; | |
| 104 | + arguments << "--projectAPIKey=" + projectAPIKey << " "; | |
| 105 | + arguments << "--sessionID=" + sessionID << " "; | |
| 103 | 106 | |
| 104 | 107 | connect(_screenshareProcess.get(), &QProcess::errorOccurred, |
| 105 | 108 | [=](QProcess::ProcessError error) { qDebug() << "ZRF QProcess::errorOccurred. `error`:" << error; }); |
| @@ -171,23 +174,15 @@ void ScreenshareScriptingInterface::startScreenshare(const QUuid& screenshareZon · 65 unmodified lines | ||
| 171 | 174 | responseObject.insert("method", "receiveConnectionInfo"); |
| 172 | 175 | QJsonObject responseObjectData; |
| 173 | 176 | responseObjectData.insert("token", token); |
| 174 | − responseObjectData.insert("projectAPIKey", apiKey); | |
| 177 | + responseObjectData.insert("projectAPIKey", projectAPIKey); | |
| 175 | 178 | responseObjectData.insert("sessionID", sessionID); |
| 176 | 179 | responseObject.insert("data", responseObjectData); |
| 177 | 180 | |
| 178 | 181 | qDebug() << "ZRF HERE! Inside `webEventReceived(). `responseObject.toVariantMap()`:" |
| 179 | 182 | << responseObject.toVariantMap(); |
| 180 | 183 | |
| 181 | − // Attempt 1, we receive the eventBridge message, but this won't send a message | |
| 182 | − // to that js | |
| 183 | 184 | auto esi = DependencyManager::get<EntityScriptingInterface>(); |
| 184 | 185 | esi->emitScriptEvent(_screenshareViewerLocalWebEntityUUID, responseObject.toVariantMap()); |
| 185 | − | |
| 186 | − // atempt 2, same outcome | |
| 187 | − //auto entityTreeRenderer = DependencyManager::get<EntityTreeRenderer>(); | |
| 188 | − //auto webEntityRenderable = | |
| 189 | − // entityTreeRenderer->renderableForEntityId(_screenshareViewerLocalWebEntityUUID); | |
| 190 | − //webEntityRenderable->emitScriptEvent(responseObject.toVariantMap()); | |
| 191 | 186 | } |
| 192 | 187 | } |
| 193 | 188 | }); |