Skip to content

Commit 7aae57f

Browse files
author
Roger
committed
additional comment updates
1 parent 828b30d commit 7aae57f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This is a simple example app which demonstrates how to use the MentraOS Camera API to take photos and display them in a webview.
44

5+
You could also send the photo to an AI api, store it in a database or cloud storage, send it to Roboflow, or do other processing.
6+
57
### Install MentraOS on your phone
68

79
MentraOS install links: [mentra.glass/install](https://mentra.glass/install)

src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class ExampleMentraOSApp extends AppServer {
7878
}
7979
});
8080

81-
// every 2 seconds, check if we are in streaming mode and if we are ready to take another photo
81+
// repeatedly check if we are in streaming mode and if we are ready to take another photo
8282
setInterval(async () => {
8383
if (this.isStreamingPhotos.get(userId) && Date.now() > (this.nextPhotoTime.get(userId) ?? 0)) {
8484
try {
@@ -97,7 +97,7 @@ class ExampleMentraOSApp extends AppServer {
9797
this.logger.error(`Error auto-taking photo: ${error}`);
9898
}
9999
}
100-
}, 2000);
100+
}, 1000);
101101
}
102102

103103
protected async onStop(sessionId: string, userId: string, reason: string): Promise<void> {
@@ -121,6 +121,10 @@ class ExampleMentraOSApp extends AppServer {
121121
filename: photo.filename,
122122
size: photo.size
123123
};
124+
125+
// this example app simply stores the photo in memory for display in the webview, but you could also send the photo to an AI api,
126+
// or store it in a database or cloud storage, send it to roboflow, or do other processing here
127+
124128
// cache the photo for display
125129
this.photos.set(userId, cachedPhoto);
126130
// update the latest photo timestamp

views/photo-viewer.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
if (response.status === 404) {
6363
// No photo available
6464
document.getElementById('content').innerHTML =
65-
'<div class="no-photo">No photos taken yet. Take a photo using your MentraOS device!</div>';
65+
'<div class="no-photo">No photos taken yet. Take a photo using your Mentra Live by pressing the right button!</div>';
6666
return;
6767
}
6868

0 commit comments

Comments
 (0)