videojs / videojs-vr

A plugin to add 360 and VR video support to video.js.
https://videojs-vr.netlify.com/
MIT License
541 stars 144 forks source link

Initial orientation of camera is wrong on Android #139

Open JL-Vidinoti opened 6 years ago

JL-Vidinoti commented 6 years ago

Description

When playing a 360 video on Android, the initial orientation of the camera is not the expected orientation. When the video starts, the "front" of the video is orientated towards the floor. This can be reproduced with the default examples.

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. Open an example on an Android device
  2. Start the video

Results

Expected

The video starts and the "front" of the video is positioned in front of the user.

Actual

The video starts and the "front" of the video is positioned towards the floor and sometimes on the side.

Additional Information

I have tested this with two different devices and the problem appears on both

versions

videojs

7.1.0

videojs-vr

1.4.7

browsers

Chrome 69 / Chrome 68

OSes

Android 8.0.0 / Android 6.0.1 Samsung Galaxy S8 / Lenovo PB2-690M

plugins

videojs-vr

joshhoegen-natgeo commented 5 years ago

Hey @JL-Vidinoti, I have the same issue. I think we should be able to address it by setting either player.vr().camera or player.vr().cameraVector objects. However, I see that @jacky841102 (https://github.com/videojs/videojs-vr/issues/157) and @atgillette (https://github.com/videojs/videojs-vr/issues/150) have similar issues... I seem to have the most issues with videojs-vr when using es2016 syntax.

I'll update back if I have any updates...

mrkos67 commented 4 years ago

I'm assuming this hasn't been updated or fixed since I'm also having this issue more than a year later (and that this issue hasn't been closed).

issimissimo commented 2 years ago

I've solved in this way;

const resetCameraPitch = setInterval(() => { if (this.vp.vr().camera !== undefined) { this.ResetCamera(); clearInterval(resetCameraPitch); } }, 1000)

ResetCamera: function(){ this.vp.vr().camera.position.x = 0; this.vp.vr().camera.position.y = 0; }

filakhtov commented 2 years ago

@issimissimo there is an initialized event and you can use it like:


player.vr().on('initialized', () => {
    player.vr().camera.position.x = 0;
    player.vr().camera.position.y = 0;
});