alexa / alexa-smart-screen-sdk

⛔️ DEPRECATED Active at https://github.com/alexa/avs-device-sdk
Apache License 2.0
76 stars 26 forks source link

How to use Alexa Presentation states for launching browser #121

Closed abkant closed 2 years ago

abkant commented 2 years ago

IMPORTANT: Before you create an issue, please take a look at our Issue Reporting Guide.

Briefly summarize your issue:

Hi, I am working on SmartScreen SDK 2.8.0 and trying to integrate this in the EvoConnect product. My requirement is to launch the browser only when we have anything to display in the browser, otherwise it will be active in the background (Foreground some other app will be active). I was just exploring the different state we maintain in AlexaPresentation like renderDocument, focusChanged, cardCleared, etc. I just want to understand whether I can use these events for this requirement of launching the browser on a need basis? If we are in renderDocument state, make the browser as an active app running in foreground and if we are in cardCleared state then push the browser to the background. Or this should be handled in another way. Can anyone comment on this.

What is the expected behavior?

NA

What behavior are you observing?

NA

Provide the steps to reproduce the issue, if applicable:

NA

Tell us about your environment:

What version of the AVS Device SDK are you using?

  <2.8.0>

Tell us what hardware you're using:

Tell us about your OS (Type & version):

Have you tried the same use case with AVS Device SDK SampleApp?

sngoc-amazon commented 2 years ago

Hi @abkant,

The Smart Screen SDK uses several CA interfaces (TemplateRuntime and APL) for rendering visual content. The C++ layer sends across IPC messages from the GUIClient.cpp to the JS layer for rendering the payloads using the apl-client-js library.

aplRender, clearDocument, renderPlayerInfo, and clearPlayerInfoCard messages received on the JS layer can be used to get notified of a rendered/cleared window. In the Smart Screen Sample Application, several windows (fullscreen, playerInfo and overlay) are present and render within a single browser. It's possible to render a window per browser/app and close the browser/app when the window is closed.

mdaix-az commented 2 years ago

Closing due to inactivity. Please reopen if needed.

abkant commented 2 years ago

Thanks for the clarification. I have a few more queries for my trials done as following  and hence reopening this

  1. Launch the browser much ahead (may be at the listening/thinking state) before receiving the render Directive - Browser displays the display card successfully

    1. Launch the browser just when we receive render Directive - Browser misses the display of APL card and nothing gets displayed in the browser. In this case, we do see that the communication is established between websocket client and server with all the commands received by the js client. If we receive another render Directive in this situation, then browser is able to display the card successfully.

    2. Relaunch/reload the browser in between of the active directive - Browser misses the display of remaining portion of APL card and nothing gets displayed in the browser. If we receive another render Directive in this situation, then browser is able to display the card successfully.

    Can you please help us in understanding the dependency of SSDK with browser in more depth. As our requirement was to launch the browser only when we receive render Directive, for all other cases we can skip launching the browser. With these trials it seems like browser should be active always, is this the requirement of SSDK? Can you please comment.