Add hardware api for camera, audio input/output selection. (#147)
* chore: Add hardware api for device settings dialog, camera preview, audio input/output selection. * update. * update flutter-webrtc. * chore: add popupmenu for audio/video selection. * chore: Improve menu tooltip text. * Removed hardware settings dialog, added it to experimental branch. * remove unused code. * Respond to device changes. * fixed `flutter analyze`. * update. * bump verion to v1.1.1.
This commit is contained in:
@@ -81,4 +81,16 @@ extension LocalVideoTrackExt on LocalVideoTrack {
|
||||
options.copyWith(cameraPosition: position),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> switchCamera(String deviceId) async {
|
||||
final options = currentOptions;
|
||||
if (options is! CameraCaptureOptions) {
|
||||
logger.warning('Not a camera track');
|
||||
return;
|
||||
}
|
||||
|
||||
await restartTrack(
|
||||
options.copyWith(deviceId: deviceId),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user