Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media Recording Changes #62

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions lib/src/media_recorder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ class MediaRecorder extends _interface.MediaRecorder {
final _interface.MediaRecorder _delegate;

@override
Future<void> start(String path,
{MediaStreamTrack? videoTrack, RecorderAudioChannel? audioChannel}) =>
Future<void> start(
String path, {
MediaStreamTrack? videoTrack,
RecorderAudioChannel? audioChannel,
MediaStreamTrack? audioTrack,
int rotationDegrees = 0,
}) =>
_delegate.start(path, videoTrack: videoTrack, audioChannel: audioChannel);

@override
Future stop() => _delegate.stop();
Future stop({String? albumName}) =>
_delegate.stop(albumName: albumName ?? 'FlutterWebRtc');

@override
void startWeb(
Expand All @@ -27,4 +33,9 @@ class MediaRecorder extends _interface.MediaRecorder {
mimeType: mimeType ?? 'video/webm',
timeSlice: timeSlice,
);

@override
Future<void> changeVideoTrack(MediaStreamTrack videoTrack) {
throw 'Unimplemented on Web';
}
}
12 changes: 9 additions & 3 deletions lib/src/media_recorder_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class MediaRecorderWeb extends MediaRecorder {
Future<void> start(
String path, {
MediaStreamTrack? videoTrack,
MediaStreamTrack? audioTrack,
RecorderAudioChannel? audioChannel,
int? rotation,
MediaStreamTrack? audioTrack,
int rotationDegrees = 0,
}) {
throw 'Use startWeb on Flutter Web!';
}
Expand Down Expand Up @@ -64,8 +64,14 @@ class MediaRecorderWeb extends MediaRecorder {
}

@override
Future<dynamic> stop() {
Future<dynamic> stop({String? albumName}) {
_recorder.stop();
return _completer.future;
}

@override
Future<void> changeVideoTrack(MediaStreamTrack videoTrack) {
// TODO: implement changeVideoTrack
throw UnimplementedError();
}
}