media-kit / media-kit

A cross-platform video player & audio player for Flutter & Dart.
https://github.com/media-kit/media-kit
MIT License
916 stars 132 forks source link

[Bug Report][video_player_media_kit] `setVolume` #522

Closed Fantuan-cell closed 6 months ago

Fantuan-cell commented 7 months ago

dependencies:

video_player_media_kit: ^1.0.2
  media_kit_libs_android_video: any
  media_kit_libs_ios_video: any #ios

There is no sound when playing videos using video_player_media_kit. What needs to be set?

mycode

void main() async {

  VideoPlayerMediaKit.ensureInitialized(
    android: true,
    iOS: true,
  );
  runApp(const AppPage());
}

image

alexmercerind commented 7 months ago

Please share sample file/URL.

You may mail me at <alexmercerind@gmail.com>.

Fantuan-cell commented 7 months ago

Please share sample file/URL.

You may mail me at [alexmercerind@gmail.com](mailto:alexmercerind@gmail.com).

http://v16m-default.akamaized.net/3f2c6031ae8d97c64fdb704f22e7d8a4/6520652b/video/tos/alisg/tos-alisg-ve-0051c001-sg/oc6VcPnlg8ADRaBH46DQsZDfBh2wbNpfl9Y4gd/?a=2011&ch=0&cr=0&dr=0&net=5&cd=0%7C0%7C0%7C0&br=4320&bt=2160&bti=MzhALjBg&cs=0&ds=4&ft=iJOG.y7oZZv0PD1Z.xLxg9wz.DKlBEeC~&mime_type=video_mp4&qs=0&rc=OWg7OGVpOzNmMzU7Zzo6N0BpM3E8ZTs6ZnNwbjMzODYzNEBiLWBhNl40NTAxYmBiNV4uYSNjXm9jcjRfLmNgLS1kMC1zcw%3D%3D&l=202310061251283470A365E672599510D4&btag=e000a8000

https://vkceyugu.cdn.bspapp.com/VKCEYUGU-ce0dc77e-96a6-43bc-b253-359189a82422/feb8aa30-56c4-49fb-bed9-1307f007ba9c.mp4

alexmercerind commented 7 months ago

Are you using emulator by any chance?

Fantuan-cell commented 7 months ago

I am using a real phone and the system is Android 8.0

Fantuan-cell commented 7 months ago

My phone directly uses the video_player plugin to play videos, and there is sound and picture.

Fantuan-cell commented 7 months ago

My phone directly uses the Video_player plugin to play videos, and there is sound and picture.

But when using video_player_media_kit to play videos, there will be no sound.

alexmercerind commented 7 months ago

Does our default media_kit test application work well?

You can download pre-built APK from our README:

https://github.com/media-kit/media-kit#platforms

alexmercerind commented 7 months ago

We use OpenSL ES audio output driver by default.

alexmercerind commented 7 months ago

Hi!

Your feedback will be helpful. We're committed to resolve your issue.

alexmercerind commented 7 months ago

Hi @Fantuan-cell.

I updated media_kit_libs_android_video in recently; you may test if your issue is resolved.

Also: Does mpv-android work on your device?

longgong commented 6 months ago

I also have similar problems, no sound in windows。

longgong commented 6 months ago

@alexmercerind There is no sound even when using the demo you provided.

abdelaziz-mahdy commented 6 months ago

@longgong do you call setVolume anywhere in your code? i think that was the problem check fix in: https://github.com/media-kit/media-kit/pull/598,

you can test it by adding in pubspec

dependency_overrides:
  video_player_media_kit:
    git:
      url: https://github.com/zezo357/media_kit
      path: ./video_player_media_kit
      ref: fix-sound

and let me know if fixed the issue for you so we merge it

longgong commented 6 months ago

@longgong do you call setVolume anywhere in your code? i think that was the problem check fix in: #598,

you can test it by adding in pubspec

dependency_overrides:
  video_player_media_kit:
    git:
      url: https://github.com/zezo357/media_kit
      path: ./video_player_media_kit
      ref: fix-sound

and let me know if fixed the issue for you so we merge it

yes,I just saw that modification. There is sound now.

abdelaziz-mahdy commented 6 months ago

Glad to hear that, I think this issue need to be reopened @alexmercerind until it's merged so I will reopen it.