MozillaReality / FirefoxReality

INACTIVE - A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://mzl.la/reality
Mozilla Public License 2.0
767 stars 216 forks source link

[canvas] canvas.transferControlToOffscreen(); does not work #3522

Closed KyungWonPark closed 6 days ago

KyungWonPark commented 4 years ago

Configuration

Firefox Reality version: Firefox Reality 10.1 Firefox Reality build ID: 54b1018b

Hardware: Oculus Go

Steps to Reproduce

  1. git clone https://github.com/131/h264-live-player (on your pc or server)
  2. npm install, then run package
  3. Access http://server-ip:8080/index_ww.html

Current Behavior

JS code stops/deviates from normal execution at certain point, due to "canvas.transferControlToOffscreen();"

Please see details

Expected Behavior

Video should be played fine

Details

Firefox Reality can't run "canvas.transferControlToOffscreen();" normally

These lines are codes related with this bug

var canvas = document.createElement("canvas");
document.body.appendChild(canvas);

// Create h264 player
var uri = "ws://" + document.location.host;
const ww = new Worker('http-live-player-worker.js');
const ofc = canvas.transferControlToOffscreen()

I have tried with Oculus Browser, and it works just fine. I debugged these lines by inserting lines in between, to see how much JS progresses, and Firefox Reality stops at "const ofc = canvas.transferControlToOffscreen()"

I'm very sure that canvas offscreen rendering is the problem

https://iamsjy17.github.io/offscreenCanvas/index.html

This offscreen render demo page renders two circles, one from the main thread and the other from the worker.

PC and phone play this fine, Oculus Go with Oculus Browser plays fine But Firefox Reality does not draw any of two circles

Thank you

bluemarvin commented 4 years ago

As far as I can tell, this only works in Chrome. I tested in Firefox desktop and Safari and it did not work in either one.

KyungWonPark commented 4 years ago

As far as I can tell, this only works in Chrome. I tested in Firefox desktop and Safari and it did not work in either one.

Hmm https://developer.mozilla.org/ko/docs/Web/API/OffscreenCanvas Then this compat matrix must be wrong I tried firefox on my PC, with offscreencanvas option on, but it doesnt work and error on console says it's not implemented

Do you have plan to implement this feature? I think this one could be very useful for rendering heavy stuffs on web