AirConsole / airconsole-unity-plugin

A plugin for Unity to develop for AirConsole
http://developers.airconsole.com/#/guides/unity
GNU Lesser General Public License v3.0
69 stars 19 forks source link

Question / Bugreport / Request: Support for Geolocation and deviceorientation events in controller #45

Closed dreamora closed 1 year ago

dreamora commented 1 year ago

Sorry if I don't follow certain desired structures.

It is possible I am doing something that is currently not meant to be supported but in my mind and based on different experiments, AirConsole has the potential to be a fantastic 'metaverse game platform' so I would at least like to inquire if it is an error on my side.

Context

I hoped to explore 'realworld multiplayer games' and potentially create one or more games on top of AirConsole.

For this I rely on two web apis:

Platform

How to reproduce

Expand the pong controller.html with

if(navigator.geolocation) {
        let upButton = document.getElementById("up_button");
        geolocationWatch = navigator.geolocation.watchPosition(function(position) {
          downButton.innerText = `Latitude: ${position.coords.latitude}; Longitude: ${position.coords.longitude}`;
        }, null, { maximumAge: 5000, timeout: 5000, enableHighAccuracy: true });
      } else {
          console.error("Geolocation is not supported by this browser.");
      }

and give the up button id="up_button"

Issue

When trying to use a controller with geolocation API I get the following error:

feature policy 'Geolocation' check failed for iframe with origin 'http://IP:7842' and allow attribute 'autoplay; microphone; camera'.

According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy/geolocation this would imply that the iframe of the controller gets embedded with insufficient policy rights. As the controller gets embedded through an iframe, this appears to be an impossible to overcome blockade.

Question

daniel-n-dream commented 1 year ago

Hi Dreamora,

Thank you for your interest and sorry for the delay in the reply:

dreamora commented 1 year ago

Hello Daniel

Thank you very much for the reply.

Looking forward to any potential plan that might arise from the car use cases along this line and potentially similar lines that would be fun for metaverse or 'real user meets extended reality' usecases (geolocation and audio in particular - the orientation was meant merely to act as input for audio output and visual hints to guide a user without being glued to the screen while moving through the world)

will close this issue then as there is no action to take.