smwebsdk.contentawareness.buildupdatecontentawarenessrequest
Home > @soulmachines/smwebsdk > ContentAwareness > buildUpdateContentAwarenessRequest
ContentAwareness.buildUpdateContentAwarenessRequest() method
Builds the required UpdateContentAwareness message that gets sent to the server
Signature:
buildUpdateContentAwarenessRequest(viewWidth: number, viewHeight: number, videoFrame: ContentAwarenessObjectModel, content: Array<ContentAwarenessObjectModel>): UpdateContentAwarenessRequestBody;
Parameters
Parameter | Type | Description |
---|---|---|
viewWidth | number | the width of the browser window |
viewHeight | number | the height of the browser window |
videoFrame | ContentAwarenessObjectModel | an object containing the coordinates of the video element in which the persona exists |
content | Array<ContentAwarenessObjectModel> | an array of objects containing the coordinates of the content elements the persona should be aware of |
Returns:
UpdateContentAwarenessRequestBody
- UpdateContentAwarenessRequestBody the message body to send
The return value from this function should be passed to scene.sendRequest('updateContentAwareness', body)