fluffychat/lib/utils/voip/user_media_manager.dart
TheOneWithTheBraid e5c03ffb53 feat: implement WebRTC calls
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
2022-02-16 14:50:48 +01:00

28 lines
624 B
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter_ringtone_player/flutter_ringtone_player.dart';
class UserMediaManager {
factory UserMediaManager() {
return _instance;
}
UserMediaManager._internal();
static final UserMediaManager _instance = UserMediaManager._internal();
Future<void> startRingingTone() {
if (kIsWeb) {
throw 'Platform [web] not supported';
}
return FlutterRingtonePlayer.playRingtone(volume: 80);
}
Future<void> stopRingingTone() {
if (kIsWeb) {
throw 'Platform [web] not supported';
}
return FlutterRingtonePlayer.stop();
}
}