W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > September 2019

Re: [mediacapture-record] Add replaceStream to MediaRecorder (#186)

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Fri, 13 Sep 2019 23:33:54 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-531421759-1568417632-sysbot+gh@w3.org>
Discussed this with @Pehrsons and we have some concerns with this API.

While browsers today appear limited to recording only one video track and one audio track, there's no such limitation in the spec, so we think we need to consider how to handle several tracks.

Say someone records a stream like this:
```js
const stream = new MediaStream([videoTrack, englishAudioTrack, frenchAudioTrack]);
const recorder = new MediaRecorder(stream);
recorder.start();
```
How would they replace just the french audio? Tracks in a MediaStream unfortunately are unordered.

So we'd like to propose this instead:
```js
await recorder.replaceTrack(frenchAudioTrack, directorsCommentaryTrack);
```
In addition, we propose to no longer stop the recorder if a stream's track-set changes, because it no longer makes sense to react to those. Instead, we'd copy the track-set in `start()`, and only stop on the first track `ended`.

If the tracks' isolation properties differ, `replaceTrack` would reject with `SecurityError`.

If`stop()` followed by `start()` is called again then the stream can be examined anew.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-record/pull/186#issuecomment-531421759 using your GitHub account
Received on Friday, 13 September 2019 23:33:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:22:28 UTC