Skip to content

Add selectAudioOutput method to MediaDevices #8

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

Merged
merged 1 commit into from
Aug 3, 2022
Merged
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
13 changes: 13 additions & 0 deletions lib/src/mediadevices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ abstract class MediaDevices {
/// change included in the event object; to get the updated list of devices,
/// you'll have to use enumerateDevices().
Function(dynamic event)? ondevicechange;

/// Prompts the user to select a specific audio output device.
Future<MediaDeviceInfo> selectAudioOutput([AudioOutputOptions? options]);
}

/// This describe the media input and output devices, such as microphones,
Expand Down Expand Up @@ -152,3 +155,13 @@ class MediaDeviceInfo {
/// (for example "External USB Webcam").
final String label;
}

/// An object that configures what device(s) may be offered in the user prompt.
class AudioOutputOptions {
AudioOutputOptions({
this.deviceId = "",
});

/// A string representing the id of the (only) device to display in the prompt (with default value: "").
final String deviceId;
}