Open indacurdev opened 3 months ago
Facing the same issue, audio plays fine on Android.
@indacurdev Found a fix.
~~Using the NativeVideoPlayerController, I was first setting the volume and then playing the video. I flipped this and now audio is working.~~
Future<void> _initializeController(
NativeVideoPlayerController controller,
) async {
_controller = controller;
controller.onPlaybackEnded.addListener(_onPlaybackEnded);
final videoSource = await VideoSource.init(
path: _filePath!,
type: VideoSourceType.file,
);
await controller.loadVideoSource(videoSource);
await controller.play();
await controller.setVolume(1);
}
Update: Now this is also not working. Don't know why it worked for sometime after I made this change. Tested on both debug and profile mode.
Ah found the reason. Turn off Silent mode. The device was on Silent mode and that's why audio was muted. Video plays fine with audio on Apple Photos and that is what I was using to check if audio is working for videos on the device.
@ashilkn thank you for looking into this and finding a solution.
@indacurdev could you please check ashilkn's solution? thanks
I found a fix for my issue. Had to set AVAudioSession to playback
on iOS for audio to work on silent mode.
Here's the code: https://github.com/ente-io/ente/pull/3037/files
I'm trying to use a package to select videos from the gallery and although the video itself plays fine, even if I set the volume to 1, 1.0, 100, etc., the audio is never heard. I even added a slider with the volume control and I didn't get any major results.