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

Buffering Songs on iOS not working immediately #29

Closed
md186 opened this issue May 21, 2020 · 5 comments
Closed

Buffering Songs on iOS not working immediately #29

md186 opened this issue May 21, 2020 · 5 comments

Comments

@md186
Copy link

md186 commented May 21, 2020

Hello, buffering on iOS with WLAN off is not working as expected. (Please check it on android too) I tested it on several real iPhones, if WLAN is off and I use LTE or other mobile network, song starts playing first, when complete song is initialized, and then it starts buffering at very last. This causes waiting for song start playing very long time. It is wrong order. If wlan is on, song directly starts playing and buffering like it should

Please fix this on WLAN off mode, this is really annoying. Thank you!

@md186 md186 changed the title Issue playing songs on iOS without wlan Buffering Songs with WLAN OFF on iOS not working May 29, 2020
@jeromexiong
Copy link
Owner

hi,guys,I test the buffering loading locally. Whether WLAN or LTE, it can be buffering normally. Even if the network is switched in the buffer, it will still be loaded. Have you tried to change the audio url?

@md186
Copy link
Author

md186 commented Jun 2, 2020

Hello thank you for checking, I’m using your plugin in my app, with wlan everything is working fine the queue is:

loading list -> loading selected song and playing and buffering at the same time. It’s playing and buffering together.

Without wlan it is the following:

Loading list -> loading selected song until the complete song is loaded -> then after loading it starts playing first when buffering is starting. It starts playing later.

Buffering and playing song at the same time is only working with wlan on. With wlan of it waits until the complete song is loaded and THEN it starts buffering and after that it starts playing at the very end.

I have only network songs in the list no local Songs. Maybe that’s the issue.

@md186
Copy link
Author

md186 commented Jun 8, 2020

@jeromexiong

well after some research it seems like other mediaplayer plugin library creators did have the same issue called iOS buffering not working. It waits to download the file.

In general starting network song is slightly slower than on android player. They fixed it with the following code here. Please implement it to make the player on iOS much more faster:

AVPlayer *player = playerInfo[@"player"];

float playbackRate = [playerInfo[@"rate"] floatValue];

if (@available(iOS 10.0, *)) {
    [player playImmediatelyAtRate:playbackRate];
} else {
    [player play];
}

Apple dev documentation:
https://developer.apple.com/documentation/avfoundation/avplayer/1643480-playimmediatelyatrate?language=objc

@md186 md186 changed the title Buffering Songs with WLAN OFF on iOS not working Buffering Songs on iOS not working immediately Jun 8, 2020
@md186
Copy link
Author

md186 commented Jun 11, 2020

Closed since @jeromexiong fixed it with playImmediatelyAtRate and automaticallyWaitsToMinimizeStalling

Playing network songs on ios with wlan or lte or whatever is super fast now ! 👌

@md186 md186 closed this as completed Jun 11, 2020
@jeromexiong
Copy link
Owner

jeromexiong commented Jun 11, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants