apivideo / api.video-typescript-media-stream-composer

Easily upload videos to api.video using progressive upload from a composition of several media streams
MIT License
40 stars 11 forks source link

[Bug]: Upload called twice #22

Closed BusinessDuck closed 2 months ago

BusinessDuck commented 2 months ago

Version

0.2.4

Environment that reproduces the issue

Browser chrome Version 127.0.6533.101 (Official Build) (arm64)

Is it reproducible in the example application?

Not tested

Reproduction steps

  1. Create composer

    composerRef.current = new MediaStreamComposer({
          resolution: {
            width: Math.round(clientWidth * DPI),
            height: Math.round(clientHeight * DPI),
          },
        });
  2. Add stream to canvas

  3. Start record

 composer.startRecording({
          videoName: userName,
          uploadToken: uploadToken,
          retries: 10,
          generateFileOnStop: true,
        });
  1. const recordedFile = await composer.stopRecording();

Problem: Uploading hapen twice, because ondataavailable event caleed twice.

image

Here is one and second event details. I checked everything, i have only one call of each function on client side.

telegram-cloud-photo-size-2-5352597525602885409-y telegram-cloud-photo-size-2-5352597525602885410-y

Also m3u called loop idk what is that

image

Expected result

uploader called only one time m3u does not called

Actual result

uploader called twice

Additional context

No response

Relevant logs output

No response

BusinessDuck commented 2 months ago
image

m3u looks like hls video requested, but i dont have any players on my side, i didn't use any kind of play requests...

BusinessDuck commented 2 months ago

The problem was in timeslice parameter of recorder

image