JeremyHeleine / Photo-Sphere-Viewer

A JavaScript library to display Photo Sphere panoramas.
851 stars 945 forks source link

Gyroscop as default on mobile devices #68

Open webx2 opened 6 years ago

webx2 commented 6 years ago

Hi,

I have this code that works (after a click on the gyroscope button):

I'm looking out to set the gyroscope as default on mobile devices without clicking on the button. How and where can I do (edit) this ? Thanks in advance for a answer.
JeremyHeleine commented 6 years ago

Hi,

The gyroscope feature can be toggled with the method .toggleDeviceOrientation(). To activate it, call this method right after the PhotoSphereViewer has been created. With your variable's name: PSV.toggleDeviceOrientation();.

Is it a good solution for you? If you think an option should be added, that's definitely a thing that can be done.

webx2 commented 6 years ago

How does this look like in my code? Can you provide me a sample into my code?

I'm not so good in .js.

Thanks in advance.

JeremyHeleine commented 6 years ago

Something like that?

var div = document.getElementById('container');
var PSV = new PhotoSphereViewer({ panorama: '360/vr-test.jpg', container: div, time_anim: 3000, navbar: true, gyroscoop: true, navbar_style: { backgroundColor: 'rgba(58, 67, 77, 0.7)'}, });
PSV.toggleDeviceOrientation();
webx2 commented 6 years ago

Hi Jeremy,

Yes this code do the trick on IOS! Great !

When the photo is loading the visitors see strange text: see screenshot:

Where can I change this or load a animated gif like a spinner? (I can find this animated gif on the web)

and after this the 360 photo build slow up (see screenshot)

Now the Full Screen button that works on IOS and you script is perfect!

A lot of question not?

But I want to help you for great performance of your work.

Thanks in advance!

Herman Van Aken

http://strak.biz/
Herman Van Aken Schijfstraat 106B 2800 Mechelen M: +32 (0) 475 283 106 info@strak.biz mailto:info@strak.biz www.strak.biz http://strak.biz/ BE0578 625 784

Op 19-okt.-2017, om 18:52 heeft Jérémy Heleine notifications@github.com het volgende geschreven:

Something like that?

var div = document.getElementById('container'); var PSV = new PhotoSphereViewer({ panorama: '360/vr-test.jpg', container: div, time_anim: 3000, navbar: true, gyroscoop: true, navbar_style: { backgroundColor: 'rgba(58, 67, 77, 0.7)'}, }); PSV.toggleDeviceOrientation(); — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JeremyHeleine/Photo-Sphere-Viewer/issues/68#issuecomment-337969668, or mute the thread https://github.com/notifications/unsubscribe-auth/AfVWiXIYiZ0ti50DKvccO8PTMAzBqNTBks5st35LgaJpZM4P9OjP.

webx2 commented 6 years ago

Great job !

JeremyHeleine commented 6 years ago

Hi,

I don't see your screenshot. If you want to change the loading message, you can use the loading_msg option and set it to any text you want. If you want to display an image instead of a text, use the loading_img option.

webx2 commented 6 years ago

Dear Jeremy,

How can i set that loading image vertical and horizontal in center of the div?

Any solution for full screen on IOS?

Thanks in advance,

Herman Van Aken

http://strak.biz/
Herman Van Aken Schijfstraat 106B 2800 Mechelen M: +32 (0) 475 283 106 info@strak.biz mailto:info@strak.biz www.strak.biz http://strak.biz/ BE0578 625 784

Op 20-okt.-2017, om 18:56 heeft Jérémy Heleine notifications@github.com het volgende geschreven:

Hi,

I don't see your screenshot. If you want to change the loading message, you can use the loading_msg option and set it to any text you want. If you want to display an image instead of a text, use the loading_img option.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JeremyHeleine/Photo-Sphere-Viewer/issues/68#issuecomment-338263087, or mute the thread https://github.com/notifications/unsubscribe-auth/AfVWiXX7CZmYgj8FyMmeGEEFxepheN7fks5suNCjgaJpZM4P9OjP.

webx2 commented 6 years ago

Hi again,

Thanks for your great cooperation.

Can i somewhere hide the fullscreen icon only on mobile devices?

Thanks in advance.

Herman Van Aken

http://strak.biz/
Herman Van Aken Schijfstraat 106B 2800 Mechelen M: +32 (0) 475 283 106 info@strak.biz mailto:info@strak.biz www.strak.biz http://strak.biz/ BE0578 625 784

Op 20-okt.-2017, om 18:56 heeft Jérémy Heleine notifications@github.com het volgende geschreven:

Hi,

I don't see your screenshot. If you want to change the loading message, you can use the loading_msg option and set it to any text you want. If you want to display an image instead of a text, use the loading_img option.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JeremyHeleine/Photo-Sphere-Viewer/issues/68#issuecomment-338263087, or mute the thread https://github.com/notifications/unsubscribe-auth/AfVWiXX7CZmYgj8FyMmeGEEFxepheN7fks5suNCjgaJpZM4P9OjP.