instatrip icon indicating copy to clipboard operation
instatrip copied to clipboard

App is crashing when deactivating the fullscreen-mode

Open TimPietrusky opened this issue 4 years ago • 4 comments

I want to use a small browser-window as my computer is not very good in terms of GPU. When I reduce the size of my browser, the app still enforces a full-screen layout. Once the full-screen is deactivated, the app is crashing:

Screenshot 2021-02-28 at 23 30 29

In the dev console I see this error:

Uncaught (in promise) Error: The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.
    at fromPixels_ (main.js:1476)
    at Object.fromPixels (main.js:1476)
    at main.js:1111
    at main.js:1476
    at t.scopedRun (main.js:1476)
    at t.tidy (main.js:1476)
    at Ze (main.js:1476)
    at FaceMesh.estimateFaces (main.js:1111)
    at updateFaceMesh (main.js:111048)
    at animate (main.js:111254)

TimPietrusky avatar Feb 28 '21 22:02 TimPietrusky

Hmm, that's a pain! As a workaround, you can have the inspector open and resize the viewport, then it won't go completely full screen. That error is actually due to the preview video looping. Not sure why it was happening and I never got round to cleaning that up!

funwithtriangles avatar Mar 01 '21 16:03 funwithtriangles

@TimPietrusky do let me know if you come up with an elegant solution to this issue for low powered machines (with large screens)

funwithtriangles avatar Mar 01 '21 16:03 funwithtriangles

@funwithtriangles when using Chrome there are two more things that can be done in order to get rid of this:

  • chrome://flags/ > Override software rendering list: Enabled
  • Settings > Use hardware acceleration when available: Yes

Then it was also working for me on a computer without a good GPU.

Maybe you want to add this to the docs?

Also why do you force the user to use a full-screen application?

TimPietrusky avatar Mar 27 '21 20:03 TimPietrusky

It's a shame this can't be achieved without Chrome flags :/

I'm forcing full-screen mainly out of the assumption most people would want it and can always escape to go back. I think this is still the best approach for mobile (where you can't have different sized windows anyway) but perhaps it can be an option for desktop. It's a trade off though between more UI / more choice.

funwithtriangles avatar Mar 31 '21 09:03 funwithtriangles