Skip to content

Commit

Permalink
fix: Simulate a device that supports video (#37)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
clara-jr committed Feb 27, 2023
1 parent 25a2607 commit 64d4f8a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/factory/RequestBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export abstract class RequestBuilder {
}
if (this.settings.interfaces!.video) {
ctx.System.device!.supportedInterfaces.VideoApp = {};
ctx.Viewport = { video: { codecs: ['H_264_41', 'H_264_42'] } };
}
if (this.settings.interfaces!.apl) {
ctx.System.device!.supportedInterfaces['Alexa.Presentation.APL'] = { runtime: { maxVersion: '1.3' } };
Expand Down

0 comments on commit 64d4f8a

Please sign in to comment.