Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari 15 - THREE.WebGLRenderer: Context Lost. #1

Open
olihulland opened this issue Sep 24, 2021 · 1 comment
Open

Safari 15 - THREE.WebGLRenderer: Context Lost. #1

olihulland opened this issue Sep 24, 2021 · 1 comment

Comments

@olihulland
Copy link

When running on Safari 15 I get a THREE.WebGLRenderer: Context Lost error causing the page to keep loading and the photosphere not to be shown.

Have been trying to update dependencies in a fork to see if this can be resolved.

Note: I had a similar error with a-frame which was fixed by updating to a newer version of aframe/THREE.

@olihulland
Copy link
Author

olihulland commented Sep 28, 2021

Due to time limitations I have chosen to just implement my own component using the same underlying photo-sphere-viewer library (I used v4.2.1 rather than older version used here). This works fine which suggests issue is due to outdated dependency.


Source code for component if someone else is facing the same problem:

(Look into https://photo-sphere-viewer.js.org docs for options to change/set in componentDidMount)

yarn add photo-sphere-viewer

MyPhotoSphere.js:

import React, {Component} from 'react';
import { Viewer } from 'photo-sphere-viewer';
import 'photo-sphere-viewer/dist/photo-sphere-viewer.css';

class MyPhotoSphere extends Component {
    constructor(props) {
        super(props);
    }

    componentDidMount() {
        const viewer = new Viewer({
            container: document.querySelector("#viewer"),
            panorama: this.props.src,
        });
        viewer.setOption('autorotateSpeed', this.props.animRPM+'rpm')
        viewer.startAutorotate();
    }

    render() {
        return <div id="viewer" style={{height: this.props.height}} />;
    }
}

export default MyPhotoSphere;

To Use:

<MyPhotoSphere src={url} height={400} animRPM={2} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant