From 43e16edc8b2ee39aa6bdcc386e7ae4d5b060eca9 Mon Sep 17 00:00:00 2001 From: Dima Rostopira <rostopiradv@gmail.com> Date: Thu, 10 Nov 2022 13:09:52 +0300 Subject: [PATCH 1/2] [WIP] Add MediaRecorder for iOS and OSX Don't merge yet! Work in progress. PR will be ready soon. --- lib/src/media_recorder.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/src/media_recorder.dart b/lib/src/media_recorder.dart index 0f51849..d0c07c6 100644 --- a/lib/src/media_recorder.dart +++ b/lib/src/media_recorder.dart @@ -3,12 +3,16 @@ import 'media_stream.dart'; import 'media_stream_track.dart'; abstract class MediaRecorder { - /// For Android use audioChannel param - /// For iOS use audioTrack + /// Starts recording to file at [path]. + /// Optionally, on Android choose [audioChannel] to record. + /// Optionally, on iOS/OSX set [audioTrack] to record. Only remote audio + /// tracks are supported! + /// On web platform use [startWeb] instead. Future<void> start( String path, { MediaStreamTrack? videoTrack, RecorderAudioChannel? audioChannel, + MediaStreamTrack? audioTrack, }); /// Only for Flutter Web From 6cbc530381e6236689b29f57fc59eb96d4b47224 Mon Sep 17 00:00:00 2001 From: Dima Rostopira <rostopiradv@gmail.com> Date: Thu, 10 Nov 2022 17:32:24 +0300 Subject: [PATCH 2/2] Add rotation parameter and changeVideoTrack Those will be implemented soon --- lib/src/media_recorder.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/media_recorder.dart b/lib/src/media_recorder.dart index d0c07c6..a2bd668 100644 --- a/lib/src/media_recorder.dart +++ b/lib/src/media_recorder.dart @@ -7,13 +7,18 @@ abstract class MediaRecorder { /// Optionally, on Android choose [audioChannel] to record. /// Optionally, on iOS/OSX set [audioTrack] to record. Only remote audio /// tracks are supported! + /// Optionally, [rotationDegrees] allows to rotate resulting video. /// On web platform use [startWeb] instead. Future<void> start( String path, { MediaStreamTrack? videoTrack, RecorderAudioChannel? audioChannel, MediaStreamTrack? audioTrack, + int rotationDegrees = 0, }); + + /// Changes current video track + Future<void> changeVideoTrack(MediaStreamTrack videoTrack); /// Only for Flutter Web void startWeb(