Can IFRAME be switched to VR Cardboard Mode Programmatically?


(Glasshandvr) #1

Can this code be modified such that on a mobile device the browser goes directly into Cardboard mode?

<!-- Initialize the viewer -->
<script type="text/javascript">
var iframe = document.getElementById( 'api-frame' );
var version = '1.0.0';
var urlid = '311d052a9f034ba8bce55a1a8296b6f9';
var client = new Sketchfab( version, iframe );

client.init( urlid, {
    success: function onSuccess( api ){
        api.start();
        api.addEventListener( 'viewerready', function() {

            // API is ready to use
            // Insert your code here
            console.log( 'Viewer is ready' );

        } );
    },
    error: function onError() {
        console.log( 'Viewer error' );
    }
} );
</script>

split this topic #2

2 posts were merged into an existing topic: Start IFRAME in VR Mode


closed #3