Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate a device that supports video #31

Closed
clara-jr opened this issue Jan 31, 2023 · 4 comments
Closed

Simulate a device that supports video #31

clara-jr opened this issue Jan 31, 2023 · 4 comments

Comments

@clara-jr
Copy link
Contributor

Using the condition .withInterfaces({ video: true }).build() to build a request does not set the handlerInput.requestEnvelope.context.Viewport.video to true in order to simulate a device that does support video. It only changes the value of handlerInput.requestEnvelope.context.System.device.supportedInterfaces.VideoApp.

Do you think it's possible to add something like this in the RequestBuilder?

if (this.settings.interfaces.video) {
  ctx.System.device.supportedInterfaces.VideoApp = {};
  ctx.Viewport = { video: true }
}
@hoegertn
Copy link
Member

Happy to change that. Could somebody please verify this or link to docs explaining this? I want to make sure that this will always be true

@clara-jr
Copy link
Contributor Author

clara-jr commented Feb 2, 2023

I can share these links:

in which the Viewport object included in the Alexa requests and the video property are explained. The Viewport object contains information about the supported viewports for the user's device. Particularly, the video property would be an object including an array representing the available technologies for playing video on that device. If the device does not support playing videos, the video property will not be present. So I think that to simulate a device that supports playing video it's enough to make that property exist (or be truthy).

@hoegertn
Copy link
Member

Sorry for the delay. Sounds reasonable. Would you be able to provide a PR for this?

@clara-jr
Copy link
Contributor Author

Sure! Here it is:

mergify bot pushed a commit that referenced this issue Feb 27, 2023
Using the condition `.withInterfaces({ video: true }).build()` to build a request does not make the `handlerInput.requestEnvelope.context.Viewport.video` to be _truthy_ in order to simulate a device that does support video. It only changes the value of `handlerInput.requestEnvelope.context.System.device.supportedInterfaces.VideoApp`.

The `Viewport.video` property represents an object including an array of `codecs` that contains the available technologies for playing video on the device. If it does not support playing videos, the `Viewport.video` property is not present. To simulate a device that does support playing video it should be enough to make that property exist (or be _truthy_). In this PR, this property has been set to contain an array with all the possible `codecs` that the output device could support.

Here's the related issue:
- #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants