evmux-app-framework 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -85,6 +85,7 @@ let createEventResultObject = (requestName, eventName, result) => {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
init(app) {
|
|
88
|
+
this._app = app
|
|
88
89
|
window.onmessage = this.onPostMessage.bind(this);
|
|
89
90
|
this.initRequestHandlerProjectSpecific(app)
|
|
90
91
|
}
|
|
@@ -174,18 +175,20 @@ let createEventResultObject = (requestName, eventName, result) => {
|
|
|
174
175
|
return Object.keys(appInstance.instances).length
|
|
175
176
|
}
|
|
176
177
|
|
|
177
|
-
|
|
178
|
+
setComponentProps(userAppInstanceId, componentId, props) {
|
|
178
179
|
const appInstance = this._userAppInstances[userAppInstanceId]
|
|
179
180
|
if (appInstance && appInstance.instances && appInstance.instances[componentId]) {
|
|
180
|
-
appInstance.instances[componentId]
|
|
181
|
+
Object.assign(appInstance.instances[componentId], props)
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
|
|
184
|
-
|
|
185
|
+
computeVolumeMultiplier(userAppInstanceId, componentId) {
|
|
186
|
+
if (this.getComponentCount(userAppInstanceId) <= 1) return 1
|
|
187
|
+
const isPrv = componentId.startsWith('live_')
|
|
188
|
+
if (this._app && this._app.studioMode && !isPrv) return 0
|
|
185
189
|
const appInstance = this._userAppInstances[userAppInstanceId]
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
190
|
+
const comp = appInstance && appInstance.instances && appInstance.instances[componentId]
|
|
191
|
+
if (this._app && this._app.isLandscapeAndPortraitMode && comp && comp.portraitMode) return 0
|
|
189
192
|
return 1
|
|
190
193
|
}
|
|
191
194
|
|
|
@@ -261,7 +264,7 @@ let createEventResultObject = (requestName, eventName, result) => {
|
|
|
261
264
|
}
|
|
262
265
|
else if (requestObj.request == availableRequests.getVolumeMultiplier)
|
|
263
266
|
{
|
|
264
|
-
result = { value: this.
|
|
267
|
+
result = { value: this.computeVolumeMultiplier(requestObj.userAppInstanceId, requestObj.componentId) }
|
|
265
268
|
}
|
|
266
269
|
else {
|
|
267
270
|
for (let i = 0; i < this._requestHandlers.length; i++)
|