googlearchive / vrview

Library for embedding immersive media into traditional websites.
http://developers.google.com/cardboard/vrview
Apache License 2.0
1.71k stars 1.09k forks source link

Touchscreen not working in Windows Chrome #78

Open pszafer opened 7 years ago

pszafer commented 7 years ago

Hello, I wanted to use your library to put panorama/360 photos on my website, but first thing I see, that with my touchscreen laptop I cannot move sample photo on your website https://developers.google.com/vr/concepts/vrview-web

Is it a bug or vrview library is not touch friendly on PC devices?

paulstone commented 7 years ago

Hi @pszafer

I had this problem today too on a kiosk we've installed. Did you fix the issue/find a workaround? From what I could tell, it wasn't working because the touchscreen doesn't have (or Chrome wasn't recognising) the click-and-drag event.

Thanks, Paul.

pszafer commented 7 years ago

No success so far. According to this file https://github.com/googlevr/vrview/blob/38d5ee55be8f4d1802f681c0964ab40ab9770901/src/embed/hotspot-renderer.js line 54:

 if (!Util.isMobile()) {
    // Only enable mouse events on desktop.
    body.addEventListener('mousedown', this.onMouseDown_.bind(this), false);
    body.addEventListener('mousemove', this.onMouseMove_.bind(this), false);
    body.addEventListener('mouseup', this.onMouseUp_.bind(this), false);
  }
  body.addEventListener('touchstart', this.onTouchStart_.bind(this), false);
  body.addEventListener('touchend', this.onTouchEnd_.bind(this), false);

I imagine that they implemented touchevents into library.

paulstone commented 7 years ago

Hi,

I have ended up using the A-frame library instead for the kiosk I'm working on (https://aframe.io). It works when testing it in Chrome simulating a touch PC. Just waiting to update it on the actual kiosk though to REALLY test it works though.

This is basically what I have replicated on our app: https://aframe.io/examples/showcase/sky/

On desktop/mobile you can pan around in all directions. However on touch desktop it appears to allow you to pan around left/right but NOT up/down. Luckily in our case, there is nothing interesting to see on the floor or the ceiling so this is acceptable for us :)

Hopefully this fallback/feature can/will be implemented in vrview.

Thanks, Paul.

paulstone commented 7 years ago

Just an update from me for completeness. The Aframe library worked on the actual touchscreen PC kiosk in that it allows us to pan left-right fully. No panning up or down, but that was ok for our purposes (nothing interesting to see up or down, thankfully).

borismus commented 7 years ago

The if (!Util.isMobile()) { check is incorrect. Instead, touch events should event.preventDefault() to stop the mouse event from being emitted.

On Tue, Nov 22, 2016 at 6:48 AM Paul Stone notifications@github.com wrote:

Just an update from me for completeness. The Aframe library worked on the actual touchscreen PC kiosk in that it allows us to pan left-right fully. No panning up or down, but that was ok for our purposes (nothing interesting to see up or down, thankfully).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/googlevr/vrview/issues/78#issuecomment-262259865, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQ8gN84mTFMzvllEqOArCRE3w0Urwhoks5rAwDJgaJpZM4Kzz6W .

pszafer commented 7 years ago

Do you have plans to correct it in nearest future?

RolandMac commented 7 years ago

@borismus Do you mind providing a bit more detail as to how to correct this issue.

phoenix5999 commented 7 years ago

Seem like it still not work until now.

tgunz commented 7 years ago

While A-Frame is great, it's also complete overkill for those of us looking to incorporate this kind of feature into a kiosk. I'd love to help figure out how to enable touchscreen capabilities with anyone who's got the time.