question

Alex avatar image
Alex asked

APL Pager and SpeakItem issue on Fire TV Stick (2nd Gen)

The below code works in the Developer Console (by working I mean every time I move to the next page I can hear Alexa reading the captions), but doesn't work (Alexa doesn't read the captions) on my Fire TV Stick (2nd Gen, bought end of 2018).

{
    "document": {
        "type": "APL",
        "version": "1.7",
        "license": "Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: LicenseRef-.amazon.com.-AmznSL-1.0\nLicensed under the Amazon Software License  http://aws.amazon.com/asl/",
        "settings": {},
        "theme": "dark",
        "import": [],
        "resources": [],
        "styles": {},
        "onMount": [],
        "graphics": {},
        "commands": [],
        "layouts": {
            "myPage": {
                "parameters": [
                    "internalIndex",
                    "internalCaption",
                    "internalImageUrl"
                ],
                "item": {
                    "type": "Container",
                    "id": "myPageContainer",
                    "width": "100vw",
                    "height": "100vh",
                    "items": [
                        {
                            "type": "Image",
                            "width": "100vw",
                            "height": "80vh",
                            "source": "${internalImageUrl}"
                        },
                        {
                            "type": "Text",
                            "speech": "${payload.data.properties.values[internalIndex].transformerOutput}",
                            "id": "pageText_${internalIndex}",
                            "width": "100vw",
                            "height": "20vh",
                            "text": "${internalCaption}"
                        }
                    ]
                }
            }
        },
        "mainTemplate": {
            "parameters": [
                "payload"
            ],
            "items": [
                {
                    "items": [
                        {
                            "onPageChanged": [
                                {
                                    "type": "SpeakItem",
                                    "componentId": "pageText_${event.source.value}"
                                }
                            ],
                            "items": [
                                {
                                    "type": "myPage",
                                    "internalIndex": "${index}",
                                    "internalCaption": "${data.caption}",
                                    "internalImageUrl": "${data.image}"
                                }
                            ],
                            "type": "Pager",
                            "width": "100vw",
                            "height": "100vh",
                            "id": "mainPager",
                            "data": "${payload.data.properties.values}"
                        }
                    ],
                    "type": "Container",
                    "width": "100vw",
                    "height": "100vh"
                }
            ]
        }
    },
    "datasources": {
        "data": {
            "properties": {
                "values": [
                    {
                        "name": "Page 1",
                        "caption": "First Caption",
                        "image": "https://www.maxpixel.net/static/photo/1x/Eyelashes-Fold-Skin-Grey-Elephant-Thick-Skin-Eye-4077701.jpg"
                    },
                    {
                        "name": "Page 2",
                        "caption": "Second Caption",
                        "image": "https://cdn2.picryl.com/photo/1969/12/31/neil-armstrong-on-the-moon-1-1024.jpg"
                    },
                    {
                        "name": "Page 3",
                        "caption": "Third Caption",
                        "image": "https://live.staticflickr.com/4086/5199362688_f57fa229a3_c.jpg"
                    }
                ]
            },
            "transformers": [
                {
                    "inputPath": "values[*].caption",
                    "outputName": "transformerOutput",
                    "transformer": "textToSpeech"
                }
            ]
        }
    },
    "sources": {}
}

I had a couple more advanced variations of the above pager (like using a delayed SpeakItem and AutoPage) and Alex was able to read in all cases in the simulator but couldn't do that on the Fire TV. So I simplified it to the bare minimum of reading the captions when users browse manually.


BTW, thanks to @Gaetano@Amazon for the great tutorial on APL Pager.

fire tvapl
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gaetano@Amazon avatar image
Gaetano@Amazon answered

Hello and thanks for posting.

I saw that you opened a contact-us case as well.

Please provide the information required there so that we can speed up the troubleshooting process.

Regards,
Gaetano

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gaetano@Amazon avatar image
Gaetano@Amazon answered

Update 2021-10-06:

I tested the experience and can confirm that the SpeakItem command does not get fired on Fire TV.

We are currently looking into it, I will post any update here.

Thanks again.
Gaetano.

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.