Feature Request - Add action filter for if tour is in a iframe

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
zeus360
Posts: 23
Joined: Thu Nov 08, 2018 1:30 pm

Hi Hopki - would it be possible in a future version to add an action filter which checks if the tour is in an iframe? It can be implemented possibly like the following example:
https://tommcfarlin.com/check-if-a-page ... an-iframe/

My reasoning for this is as follows: It's all to do with pesky full screen buttons and iOS devices when the tour is embedded in an iframe. The default skin hides the full screen button on iOS devices because fullscreen is not supported, I understand that. I have started modifying the default skin to show the fullscreen button and conditionally do something different depending on what conditions are met.

Where I am so far is:
  • I have removed the action filters which position and show / hide the full screen button on the default skin so that it now always shows even on iOS devices.
    I have added an action to the full screen button in the controller of Go to URL "index_fullscreen.html#$(unode)" in a new window and made it so that this only applied so iOS devices and $(unode) makes sure the current node opens rather than the start of the tour
    I have added a second output which creates index_fullscreen.html, index_fullscreen.js and index_fullscreen.xml in the same folder and cloned the skin, making the full screen button close the window on iOS devices
In an ideal world I think it would be simpler and easier to manage if there only had to be one output and skin per tour. So here's the idea I've had:
  • Make the full screen button show if it is set to show in the skin config (on the output section / settings for the tour)
    Make the toggle full screen action have an action filter of OS not equal to iOS
    Add an action of Go to URL "index.html#$(unode)" in a new window with action filter of "OS equals iOS AND iframe equals true"
    Add another action of close window / tab with an action filter of "OS equals iOS AND iframe equals false"
This way you only need one output / skin which has three actions on the full screen button depending on whether or not the user is on iOS and if the tour is in an iframe or not. This could then potentially be a whole new controller component as long as the Go to URL could be dynamic and not hard set to index.html

If you can let me know your thoughts on whether or not this is possible that wold be awesome!
Post Reply