Last active
September 24, 2019 05:07
-
-
Save dabit3/2330bf801ec84b4adf14d2590f667d14 to your computer and use it in GitHub Desktop.
AWS Amplify Sumerian Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import { withAuthenticator } from 'aws-amplify-react'; | |
import { XR } from 'aws-amplify'; | |
import sceneConfig from './sumerian-exports'; | |
XR.configure({ // XR category configuration | |
SumerianProvider: { // Sumerian specific configuration | |
region: 'eu-central-1', // Sumerian region | |
scenes: { | |
"scene1": { // Friendly scene name | |
sceneConfig // Scene configuration from Sumerian publish | |
} | |
}, | |
} | |
}); | |
class App extends Component { | |
componentDidMount() { | |
const loadAndStartScene = async () => { | |
await XR.loadScene("scene1", "sumerian-scene-dom-id"); | |
XR.start("scene1"); | |
} | |
loadAndStartScene() | |
} | |
render() { | |
return ( | |
<div className="App"> | |
<div id="sumerian-scene-dom-id"></div> | |
</div> | |
); | |
} | |
} | |
export default withAuthenticator(App, { includeGreetings: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment