Skip to main content

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

ParameterTypeDescription
viewWidthnumberthe width of the browser window
viewHeightnumberthe height of the browser window
videoFrameContentAwarenessObjectModelan object containing the coordinates of the video element in which the persona exists
contentArray<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)