takeVideo method

  1. @override
void takeVideo(
  1. BuildContext context,
  2. AppModel app,
  3. AccessRightsProvider accessRightsProvider,
  4. MediumAvailable feedbackFunction,
  5. FeedbackProgress? feedbackProgress,
)
override

Implementation

@override
void takeVideo(
    BuildContext context,
    AppModel app,
    AccessRightsProvider accessRightsProvider,
    MediumAvailable feedbackFunction,
    FeedbackProgress? feedbackProgress) {
  var ownerId = AccessBloc.memberId(context);
  if (ownerId == null) {
    throw Exception("Expecting to have a member logged in to take a photo");
  }
  var memberMediumDocumentID = newRandomKey();
  EliudCamera.openVideoRecorder(context, app, (video) async {
    var memberMediumModel = await accessRightsProvider()
        .getMediumHelper(app, ownerId)
        .createThumbnailUploadVideoFile(memberMediumDocumentID, video.path,
            feedbackProgress: feedbackProgress);
    feedbackFunction(memberMediumModel);
  }, (message) {
    print('Error during takeVideo $message');
    feedbackFunction(null);
  });
}