The Skybox API for Samsung Internet for Gear VR allows you to display a custom 360 degree background.
Examples
Equirectangular images (spherical panoramas)
// First, check if the API is available
if ('SamsungChangeSky' in window) {
// Set the spherical panorama image
window.SamsungChangeSky({ sphere: 'http://site.com/my-360-image.jpg' });
}
Mono cubemap
To set the same cubemap for both eyes:
// First, check if the API is available
if ('SamsungChangeSky' in window) {
// Set the cubemap images
window.SamsungChangeSky({ front: 'f.png', back: 'r.png', left: 'l.png', right: 'r.png', up: 'u.png', down: 'd.png' });
}
Stereo cubemap
To set different cubemaps for each eye:
// First, check if the API is available
if ('SamsungChangeSky' in window) {
// Set the cubemap images
window.SamsungChangeSky({ Lfront: 'Lf.jpg', Lback: 'Lb.jpg', Lleft: 'Ll.jpg', Lright: 'Lr.jpg', Lup: 'Lu.jpg', Ldown: 'Ld.jpg',
Rfront: 'Rf.jpg', Rback: 'Rb.jpg', Rleft: 'Rl.jpg', Rright: 'Rr.jpg', Rup: 'Ru.jpg', Rdown: 'Rd.jpg' });
}
Sample code
github.com/SamsungInternet/set-skybox
Demo
Browser support
The Skybox API was introduced in Samsung Internet for Gear VR version 4.2.