mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-22 05:22:34 +01:00
e5c03ffb53
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
28 lines
624 B
Dart
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();
|
|
}
|
|
}
|