getCurrentVolume method
Future<void>
getCurrentVolume(
)
Implementation
Future<void> getCurrentVolume() async {
if (desktopOrWeb) {
// print(
// "_videoPlayerController?.state.volume ${_videoPlayerController?.state.volume}");
if ((_videoPlayerController?.state.volume ?? 0) == 1.0) {
_currentVolume.value = (_videoPlayerController?.state.volume ?? 0);
} else {
_currentVolume.value =
(_videoPlayerController?.state.volume ?? 0) / 100;
}
} else {
try {
_currentVolume.value = await VolumeController().getVolume();
} catch (e) {
customDebugPrint("currentVolume $e");
//throw 'Failed to get current brightness';
//return 0;
}
}
//return 0;
}