Skip to content

Commit

Permalink
add cameraSource field to Media interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sultanmyrza committed Mar 14, 2023
1 parent d315e37 commit 71659da
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/shared/capture/capture.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { CameraSource } from '@capacitor/camera';
import { BehaviorSubject } from 'rxjs';
import { MimeType } from '../../utils/mime-type';
import { CollectorService } from '../collector/collector.service';
Expand All @@ -22,10 +23,10 @@ export class CaptureService {
private readonly collectorService: CollectorService
) {}

async capture(source: Media) {
async capture(media: Media) {
const proof = await Proof.from(
this.mediaStore,
{ [source.base64]: { mimeType: source.mimeType } },
{ [media.base64]: { mimeType: media.mimeType } },
{ timestamp: Date.now(), providers: {} },
{}
);
Expand All @@ -37,7 +38,8 @@ export class CaptureService {
);
const collected = await this.collectorService.run(
await proof.getAssets(),
proof.timestamp
proof.timestamp,
media.source
);
// eslint-disable-next-line rxjs/no-subject-value
const newCollectingOldProofHashes = this._collectingOldProofHashes$.value;
Expand All @@ -54,4 +56,5 @@ export class CaptureService {
export interface Media {
readonly mimeType: MimeType;
readonly base64: string;
readonly source: CameraSource;
}

0 comments on commit 71659da

Please sign in to comment.