question

Joseph Shelby avatar image
Joseph Shelby asked

Issues with HTML5 behavior on Fire 5.0

One of my two sticks has updated to 5.0, and with that, my app (SubFire Player) has several new issues that I do not know yet how to work around. It is a packaged app. I am including the amazon api in the following manner: 1) I no longer get menubutton events. Fortunately, my app has on-screen buttons for opening the configuration, but they aren't as convenient. 2) hitting the 'back' button on the remote seems to send the request twice, often causing me to exit out of the app. The latter may be the result of this: https://forums.developer.amazon.com/forums/thread.jspa?threadID=11160&tstart=0 I have the keydown check for the the ESC key because my app also works with other platforms (like the web and as a Chrome app) where I want it used that way. This one I can likely work around (trick being to not break FireOS 4 in the meantime, of course) with a little experimentation. I am not sure what to do about the menubutton yet. I do seem to still be getting the webview visibility events. That stick doesn't have a voice remote (the other one does, still on ver4), so I can't test if I'm still getting the system pause events. Searching the site no longer lists the event handler I use: document.addEventListener('menubutton', function(evt) { console.log('amazon menubutton', evt); // do something that makes sense... }, false); Joe
fire tv
10 |5000

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

Joseph Shelby avatar image
Joseph Shelby answered
As I commented on that thread, I added a check in my keyCode handler so that if I get ESC (27) and I'm running in a FireTV (checked by userAgent), then return true without explicitly popping state and the app handles the rest as expected. So that issue is resolved for me in a backwards-compatible way that doesn't break my other platforms or FireOS 4. So I did an actual dump of the keyCodes to the console in WebAppTester and discovered the same thing is happening with Menu. Menu is now sending a keyCode, 18, which it didn't used to do before. I can capture that keyCode and fake-dispatch the menubutton event and continue on my way. I'll let you decide if these keyCodes leaking through the WebView layer is a bug or a feature, but I'm back in a position to submit my app. No worries.
10 |5000

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

Joseph Shelby avatar image
Joseph Shelby answered
I think I figured out what changed. With 5.0, the Fire TV and Fire Stick can connect to bluetooth-based keyboards, according to http://www.aftvnews.com/everything-you-need-to-know-about-the-upcoming-fire-os-5-software-update-for-the-1st-gen-fire-tv-and-fire-tv-stick/#bluetooth As such, I theorize that the system could not block those original keycodes (18, 27) anymore because there is a legitimate need for those keys to be passed through to the application. Just a thought. Joe
10 |5000

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

Joseph Shelby avatar image
Joseph Shelby answered
This was answered to my satisfaction here: https://forums.developer.amazon.com/forums/thread.jspa?threadID=11160&tstart=0 I will close this as answered.
10 |5000

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