Skip to content

Conversation

@victor141516
Copy link

@victor141516 victor141516 commented Jun 16, 2022

This PR adds and example of the usage of https://github.com/revieve/revieve-web-plugin-4/pull/718

It's a new API method that pauses/resumes the liverAR camera. In the android app that's toggled when the app goes to background or foreground.

Here is the APK: https://revieve.slack.com/files/U03DTCL5PJ6/F03L1VDFSMV/app-debug.apk

@victor141516 victor141516 force-pushed the add-pause-camera-button branch from 1367a67 to 33c8960 Compare June 20, 2022 10:04
@victor141516 victor141516 changed the title feat: add button to pause/resume the camera feat: add onPause and onResume hooks to pause and resume the camera Jun 21, 2022
Comment on lines +225 to +246
@Override
protected void onPause () {
super.onPause();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
myWebView.postWebMessage(
new WebMessage("{\"type\": \"setCameraPause\", \"payload\": true}"),
Uri.parse(REVIEVE_CDN_DOMAIN)
);
}
}

@Override
protected void onResume () {
super.onResume();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
myWebView.postWebMessage(
new WebMessage("{\"type\": \"setCameraPause\", \"payload\": false}"),
Uri.parse(REVIEVE_CDN_DOMAIN)
);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be great to comment in the code why they might want to use this snippet and also mention webview.pause / resume alternatives

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