Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed getVolume #486

Merged
merged 4 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flutter_vlc_player/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'org.videolan.android:libvlc-all:3.6.0-eap9'
implementation 'org.videolan.android:libvlc-all:3.6.0-eap12'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.annotation:annotation:1.2.0'
Expand Down
2 changes: 1 addition & 1 deletion flutter_vlc_player/ios/flutter_vlc_player.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '11.0'
s.dependency 'MobileVLCKit', '~> 3.6.0b9'
s.dependency 'MobileVLCKit', '~> 3.6.0b12'
s.static_framework = true

# Flutter.framework does not contain a i386 slice.
Expand Down
8 changes: 4 additions & 4 deletions flutter_vlc_player/lib/src/vlc_player_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,11 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
}

/// Returns current vlc volume level.
Future<int> getVolume() async {
Future<int?> getVolume() async {
_throwIfNotInitialized('getVolume');
final volume =
await (vlcPlayerPlatform.getVolume(_viewId) as FutureOr<int>);
value = value.copyWith(volume: volume.clamp(0, _maxVolume));
final volume = await vlcPlayerPlatform.getVolume(_viewId);
value = value.copyWith(
volume: volume != null ? volume.clamp(0, _maxVolume) : null);

return volume;
}
Expand Down