getVolume method
@detail api @brief Gets the current volume. @param type See AudioMixingType{@link #AudioMixingType}. @return - >0: Success, the current volume. - < 0: Failed. @note Call this API only when audio is mixing, including media file mixing and PCM mixing.
Implementation
Future<int?> getVolume(AudioMixingType type) async {
$a() => ($instance as $p_a.IMediaPlayer)
.getVolume(t_AudioMixingType.code_to_android(type));
$i() => ($instance as $p_i.ByteRTCMediaPlayer)
.getVolume(t_AudioMixingType.code_to_ios(type));
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}