dllb
dllb

Reputation: 111

Pointer Lock does Not Work on Android Browsers (official demo)

This is the online demo suggested by MDN:

  1. https://mdn.github.io/dom-examples/pointer-lock/

It works on desktop, but not on mobile (Chrome, Edge, FF). Meanwhile, the pointer lock API is listed as widely supported on mobile: https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API

more demos:

  1. Quake 3 WebGL demo http://media.tojicode.com/q3bsp/

  2. http://www.smartjava.org/examples/pointerlock/

I implemented it myself too, and when I used JSON.stringify(e) to read the contents of the error event, I got: '{isTrusted:true}'

UPDATE: I used a more complex function to serialize the whole event object, so after adding the suggested by MDN event listeners:

document.addEventListener('pointerlockerror', lockError, false);
document.addEventListener('mozpointerlockerror', lockError, false);

and

function lockError(e) {
  serializeEvent(e)
}

I got from the serialize function:

the error returned

UPDATE #2: I included FF as it doesn't work either, it just doesn't raise an error, while it follows pointer erratically (at high speed), without locking it and while firing the pointerlockchange event!

Upvotes: 1

Views: 336

Answers (0)

Related Questions