feat: Ability to record videos and capture photos directly in app by selecting + in Files view (#2095)

This commit is contained in:
Aman Harwara
2022-12-13 21:41:41 +05:30
committed by GitHub
parent cd8596b14e
commit d4b63e4ea6
11 changed files with 552 additions and 39 deletions

View File

@@ -101,17 +101,17 @@ export class MomentsService extends AbstractViewController {
}
const filename = `Moment ${dateToStringStyle1(new Date())}.png`
const camera = new PhotoRecorder(filename)
const camera = new PhotoRecorder()
await camera.initialize()
if (this.application.isMobileDevice) {
await sleep(DELAY_AFTER_STARTING_CAMERA_TO_ALLOW_MOBILE_AUTOFOCUS)
}
let file = await camera.takePhoto()
let file = await camera.takePhoto(filename)
if (!file) {
await sleep(1000)
file = await camera.takePhoto()
file = await camera.takePhoto(filename)
if (!file) {
return undefined
}