webvr-ui
webvr-ui copied to clipboard
Latest Firefox nightly wont start presenting
Not giving any meaningful errros why it wont work. Looking into it now. @andreasplan8
Turns out its not anymore allowed to wrap the requestPresent into a promise. Its apparently not considered a user action anymore.
https://github.com/googlevr/webvr-ui/blob/master/src/enter-vr-button.js#L187
Not sure if this is the intended behavior from firefox.
Filed a bug on firefox to see if this is intended. https://bugzilla.mozilla.org/show_bug.cgi?id=1354573
@HalfdanJ can you try again with the latest Nightly?
@cvan tried it tonight with 55.0a1 (2017-04-13) (64-bit) and it did still reject the request to present.
@cvan, notice we have merged a hotfix, so the examples do work. But the hotfix is not the most elegant.
@HalfdanJ: can you point me to the lines in the source of the workaround?
@cvan in my tests, this made the difference: https://github.com/googlevr/webvr-ui/pull/9/commits/d898223123e3148ee1cf182c8b84bd28c286f067#diff-92e430347c391062250a259e759510deR235
If I call requestPresent
from inside a new Promise()
it works fine, but if I call requestPresent
after one more promise, it wont work, but by bypassing the beforeEnter
code in our library, it works.
So in a gist, something like this wont work (at least thats what I see in our code)
var beforeEnter = function(){
return new Promise(function(resolve){
resolve();
})
};
new Promise(function(resolve,reject){
return beforeEnter().then(function(){
startPresentation()
})
})
but this works:
new Promise(function(resolve,reject){
return startPresentation()
})
Will the builds that are posted be rebuilt with the fix?
@cvan hey chris, any info if this is considered an issue in firefox or intended behavior? If its intended we should change our library so we dont have the hotfix like this.
Fixing this is a breaking change, so scheduling for a 2.0 release
@HalfdanJ sorry, I didn't catch your comments here. this is not expected behaviour, and it needs to be fixed in Firefox. I don't have an ETA though. if you can, working around it for now would be great. thank you (and apologies)!
Ah great!