Skip to content

Best way to handle multiple video records in the same page load? #6

@benwells

Description

@benwells

We are initializing bbcore on page load, and then we have a record button on our page that spawns a modal where the user can record their video and enter a video title. Each time the modal appears, we want to record a brand new video.

When the modal appears, we are calling startVideoRecorder(). When the modal closes, we destroy the video recorder's target element to get rid of the recorder.

When a user records 2 videos in a row, we call startVideoRecorder() a 2nd time, and the problem is that the method's callback is storing and holding onto the video ID of the first video the user recorded, not the new video. This causes us to pass the wrong video id to saveRecordedVideo when the user chooses to save the new video.

What is the best way to handle this situation? I see the getVideoRecorder and getEmbeddedRecorderUrl methods in the README but there is no explanation or example of what these methods are used for or when I should use them. Are they the answer?

Is there a "stop video recorder" method that needs to be called in between startVideoRecorder calls? Do I need to somehow destroy window.bb and re-initialize the session for each video the user wants to record a new video?

Thanks for your help, sorry for blowing up your github.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions