Google vr 谷歌vr视图使用点击热点更改内容

Google vr 谷歌vr视图使用点击热点更改内容,google-vr,Google Vr,一旦我的网站上有了嵌入式vr视图,我如何实现点击热点 function onVrViewLoad() { var v; v = new VRView.Player('#vrview', { image: '/images/firstImage.jpg', is_stereo: false }); v.on('ready', function(){ v.addHotspot('hotspotOne', { pitch: 0, // In degrees

一旦我的网站上有了嵌入式vr视图,我如何实现点击热点

function onVrViewLoad() {

var v;

v = new VRView.Player('#vrview', {
    image: '/images/firstImage.jpg',
    is_stereo: false
});

v.on('ready', function(){
    v.addHotspot('hotspotOne', {
        pitch: 0, // In degrees. Up is positive.
        yaw: 180, // In degrees. To the right is positive.
        radius: 0.05, // Radius of the circular target in meters.
        distance: 2 // Distance of target from camera in meters.
    });
});

v.on('click', function(event) {
    if (event.id == 'hotspotOne') {
        v.setContentInfo({
            image: '/images/secondImage.jpg',
            is_stereo: false
        });
    }
});}

热点显示并可以单击,但不会更改图像。如果我将v.setContentInfo()替换为window.location.href='/secondImage.html',在这里我用该图像设置了另一个vr查看器,它将加载页面。因此,我知道click事件注册正确,但setContentInfo()注册不正确。

虽然文档中说要使用setContentInfo(),但我发现实际上是setContent()起作用。这让我头痛了一阵子

v.setContent({
    image: '/images/secondImage.jpg',
    is_stereo: false
});