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

Exit scene on blur with grace period #198

Merged
merged 3 commits into from
Apr 17, 2018
Merged

Conversation

robertlong
Copy link
Contributor

Tears down the aframe scene and stops microphone input when navigating away from the tab on a mobile device. Allows for a 10 second grace period to enter VR etc.

Exit screen styling depends on changes in: #177

Fixes: #91

Copy link
Contributor

@brianpeiris brianpeiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

src/hub.js Outdated
@@ -113,6 +114,13 @@ concurrentLoadDetector.start();
store.update({ profile: { ...generateDefaultProfile(), ...(store.state.profile || {}) } });

async function exitScene() {
if (NAF.connection.adapter && NAF.connection.adapter.localMediaStream) {
const tracks = NAF.connection.adapter.localMediaStream.getTracks();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very minor but since this isnt perf sensitive code at all id use forEach
NAF.connection.adapter.localMediaStream.getTracks().forEach(t => t.stop())

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

Successfully merging this pull request may close these issues.

3 participants