ryanheise / just_audio

Audio Player
1.05k stars 671 forks source link

plugin for m3u8 format doesnt work correctly in web #850

Open fatememir opened 2 years ago

fatememir commented 2 years ago

Which API doesn't behave as documented, and how does it misbehave? I have a problem in web . I read a m3u8 file from url and when i drag the music backwards or forwards , sound plays well but the state stucks in loading state . also buffering and position get wrong (position stuck ). sometimes loaiding enabled even though music play correctly.

Minimal reproduction project Provide a link here using one of two options:

  1. github.com/fatememir/just_audio_web_problem
  2. If the unmodified official example already reproduces the bug, just write "The example".

To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:

  1. Go to main.dart in just_audio examples/lib folder . 2.on line 47,replace the normal audio source with HlsAudioSource(Uri.parse( "https://aod.jaanapp.com/stream/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtb2RlbF92ZXJzaW9uIjoiMSIsInVzZXJfaWQiOiI2MDU3YzYzZThmYTBhYTMzNmU5ZTI5ODYiLCJ1c2VyX3R5cGUiOiJ2ZXJpZmllZCIsInNjb3BlcyI6W10sImV4cCI6MTc0MjA5Mzk1NX0.2EBAKTTQrqAf5Q5HFFfdaP-46JARtC2Sh3kqyl5dRtU/free/audio/6066d53bcf767b2324df6427/main/playlist.m3u8")) );
  2. now run the main.dart file and completely play the hls audio.

Error messages

no error message log

Expected behavior I expect player play file correctly but The audio playback stuck in loading state when seek and return wrong duration

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Flutter SDK version

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.3, on Microsoft Windows [Version 10.0.19044.2006], locale en-US)
Checking Android licenses is taking an unexpectedly long time...[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.1)
[√] HTTP Host Availability

Additional context Add any other context about the problem here.

ryanheise commented 2 years ago

Same problems as with the last issue. You need to follow the instructions exactly when submitting your report. See my comments below:

Minimal reproduction project Provide a link here using one of two options:

  1. Fork this repository and modify the example to reproduce the bug, then provide a link here.

  2. If the unmodified official example already reproduces the bug, just write "The example".

You need to fill in the above section. I think you should choose option 1. Fork the repository and modify the example to reproduce the bug, then provide the link here.

I went through this with you on your last issue and I thought you understood. By the way, why did you open a new issue? Are they two separate issues? If they are the same issue, can you please close one? This is too much for me to keep track of, thanks for understanding.

To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:

  1. Go to main.dart in just_audio examples/lib folder . 2.on line 47,replace the normal audio source with HlsAudioSource(Uri.parse( "https://aod.jaanapp.com/stream/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtb2RlbF92ZXJzaW9uIjoiMSIsInVzZXJfaWQiOiI2MDU3YzYzZThmYTBhYTMzNmU5ZTI5ODYiLCJ1c2VyX3R5cGUiOiJ2ZXJpZmllZCIsInNjb3BlcyI6W10sImV4cCI6MTc0MjA5Mzk1NX0.2EBAKTTQrqAf5Q5HFFfdaP-46JARtC2Sh3kqyl5dRtU/free/audio/6066d53bcf767b2324df6427/main/playlist.m3u8")) );

  2. now run the main.dart file and completely play the hls audio.

You're giving me code, but i said in the instructions "NOT CODE". I think that's clear. The code should go into your minimal reproduction project in the previous section.

fatememir commented 2 years ago
  1. https://aod.jaanapp.com/stream/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtb2RlbF92ZXJzaW9uIjoiMSIsInVzZXJfaWQiOiI2MDU3YzYzZThmYTBhYTMzNmU5ZTI5ODYiLCJ1c2VyX3R5cGUiOiJ2ZXJpZmllZCIsInNjb3BlcyI6W10sImV4cCI6MTc0MjA5Mzk1NX0.2EBAKTTQrqAf5Q5HFFfdaP-46JARtC2Sh3kqyl5dRtU/free/audio/6066d53bcf767b2324df6427/main/playlist.m3u8

i forked the project and change this path: https://github.com/fatememir/just_audio_web_problem/blob/minor/just_audio/example/lib/main.dart i just changed the url . Is this what you wanted?

i open a new issue because i think the title and description wasnt clear. im not pro in git . should i close the issue or you shoul do that?

i struggling whit this issue more than a month .please help me to find result

fatememir commented 2 years ago

Same problems as with the last issue. You need to follow the instructions exactly when submitting your report. See my comments below:

Minimal reproduction project Provide a link here using one of two options:

  1. Fork this repository and modify the example to reproduce the bug, then provide a link here.
  2. If the unmodified official example already reproduces the bug, just write "The example".

You need to fill in the above section. I think you should choose option 1. Fork the repository and modify the example to reproduce the bug, then provide the link here.

I went through this with you on your last issue and I thought you understood. By the way, why did you open a new issue? Are they two separate issues? If they are the same issue, can you please close one? This is too much for me to keep track of, thanks for understanding.

To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:

  1. Go to main.dart in just_audio examples/lib folder . 2.on line 47,replace the normal audio source with HlsAudioSource(Uri.parse( "https://aod.jaanapp.com/stream/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtb2RlbF92ZXJzaW9uIjoiMSIsInVzZXJfaWQiOiI2MDU3YzYzZThmYTBhYTMzNmU5ZTI5ODYiLCJ1c2VyX3R5cGUiOiJ2ZXJpZmllZCIsInNjb3BlcyI6W10sImV4cCI6MTc0MjA5Mzk1NX0.2EBAKTTQrqAf5Q5HFFfdaP-46JARtC2Sh3kqyl5dRtU/free/audio/6066d53bcf767b2324df6427/main/playlist.m3u8")) );
  2. now run the main.dart file and completely play the hls audio.

You're giving me code, but i said in the instructions "NOT CODE". I think that's clear. The code should go into your minimal reproduction project in the previous section.

hello,did you read my answer?

ryanheise commented 2 years ago

Can you confirm which web browsers you have tested and what was the result on each web browser?

ryanheise commented 2 years ago

Also note there is an existing issue #242 for the implementation of HLS support for web. Maybe it's the same issue as yours?

fatememir commented 2 years ago

Also note there is an existing issue #242 for the implementation of HLS support for web. Maybe it's the same issue as yours?

it seems it same as https://github.com/ryanheise/just_audio/issues/648

ryanheise commented 2 years ago

That issue is closed and replaced by #690 .

Also, can you answer my question about which web browsers you tested and what was the result on each one? Not all browsers support this so I'm surprised it's working at all.

fatememir commented 2 years ago

That issue is closed and replaced by #690 .

Also, can you answer my question about which web browsers you tested and what was the result on each one? Not all browsers support this so I'm surprised it's working at all.

i checked it on safari and what happened is what I said in the question. I read a m3u8 file from url and when i drag the music backwards or forwards , sound plays well but the state stucks in loading state . also buffering and position get wrong (position stuck ). sometimes loaiding enabled even though music play correctly.

https://user-images.githubusercontent.com/52149746/197759723-a1ac42fd-f48f-45b5-90fa-4baa5b824ceb.mp4

ryanheise commented 2 years ago

Do you mean Safari on desktop, or Safari on mobile? Looking at your movie, it looks like a phone although it doesn't look like Safari.

fatememir commented 2 years ago

Do you mean Safari on desktop, or Safari on mobile? Looking at your movie, it looks like a phone although it doesn't look like Safari.

i built in web and run the url on mac's safari emulator

ryanheise commented 2 years ago

I didn't know macs have a Safari emulator, nor do I know why a mac would need a Safari emulator when it has the real Safari. The only emulator I'm aware of is an iOS emulator. Can you explain what you mean?

fatememir commented 2 years ago

I didn't know macs have a Safari emulator, nor do I know why a mac would need a Safari emulator when it has the real Safari. The only emulator I'm aware of is an iOS emulator. Can you explain what you mean?

it is pwa version of app and we added to home and opened it. it doesnt matter because the bug appears in iphone and mac in safari browser. if the package has this certain bug for m3u8,could you suggest me other package? thanks for your quick response

ryanheise commented 2 years ago

So if I understand you correctly, you don't mean the Safari emulator, you mean Safari inside of the iPhone emulator? And in addition to that, you also tested Safari on the mac itself? So that's two browsers you tested and it was the same behaviour in both?

Regarding your last question, the purpose of this issue tracker is to help me fix bugs in this package. I do not help people with other packages.

fatememir commented 2 years ago

So if I understand you correctly, you don't mean the Safari emulator, you mean Safari inside of the iPhone emulator? And in addition to that, you also tested Safari on the mac itself? So that's two browsers you tested and it was the same behaviour in both?

Regarding your last question, the purpose of this issue tracker is to help me fix bugs in this package. I do not help people with other packages.

I tested it in Safari inside of the iPhone emulator and safari in iphone(mobile) and it has same behavior__

ryanheise commented 1 year ago

OK, so when you said "mac in safari browser" I guess you meant "safari browser in the iPhone simulator".

Although browsers generally don't support m3u8, if Safari inside iOS actually supports it then you are in luck on that front, but then you still get the same behaviour as #690 .

You can therefore follow #690 as well for further developments.