luke-chang / js-spatial-navigation

A javascript-based implementation of Spatial Navigation.
Mozilla Public License 2.0
370 stars 117 forks source link

Is there anyway I could initialize SpatialNavigation for an iframe in my application? #33

Open devcer opened 5 years ago

devcer commented 5 years ago

I have an iframe in my application and I have access to both the parent and child applications so I can choose the selectors wisely. But SpatialNavigation doesn't work if I navigate it either from parent or child. is there anyway I could do it?

luke-chang commented 5 years ago

SpatialNavigation currently doesn't support navigating cross frames. I haven't tried but I imagine that you need to load SpatialNavigation both outside and inside the iframe, manually specify and focus an element when crossing the boundary of an iframe, and let another SptialNavigation take over the rest of navigating works within the same frame.

bytet commented 4 years ago

First let me thank you Luke-Chang for your work. I have enjoyed modifying your code to recreate my website for a FireTV app.(not the silk browser) I have hit a block. I have a iframe I've been able to load YouTube videos in but either they autoplay with no sound, (the app was created for mobile) or they are unmuted but need the play button clicked. Any further experiments with iframe you can share?

bytet commented 4 years ago

I've come to accept to many security issues with iframe and YouTube video. So rather than load YouTube video to an iframe, I loading a new page with vanilla html5 video player, mp4 video and Sn . The fir TV remote back button closes the window and I return to previous page. On the desktop the last focus element is still active but on the fire TV the page resets and the top element is default. Does this sound like a browser bug?