-
Notifications
You must be signed in to change notification settings - Fork 72
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
Player doesn't work on iOS 13+ because it doesn't recognise it is a device #32
Comments
In the meantime, I have worked around this problem in my code by extending the import GreenAudioPlayer from "green-audio-player/dist/js/green-audio-player";
class GreenAudioPlayerFix extends GreenAudioPlayer {
constructor(player, options) {
super(player, options);
delete this.isDevice;
this.isDevice =
(/ipad|iphone|ipod|android/i.test(
window.navigator.userAgent.toLowerCase()
) ||
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1)) &&
!window.MSStream;
this.overcomeIosLimitations();
}
}
export default GreenAudioPlayerFix; |
would you please ellaborate how to apply this fix on a existing project the easiest way? :-) Tried to update this on Line37 with your Code but simulated iOS 13.X and real iOS 14 iPad are stuck with a spinning wheel on loading. |
@Schempershofe did you find any solution for this problem? I'm stuck with the same spinning wheel on loading. |
Nope, I´m still suck on it, I believe that it´s exactly the problem @a-sklyarov described and found a couple of different approaches on ipad device recognition for the current iPAD OS Version - none of them fixed the issue so I´m currently preparing a switch away from the green player for the project :-( |
@Schempershofe I found something... the problem is on iOS you have to do this: See the function "overcomeIosLimitations" in the js file |
@Schempershofe You can try something like that:
|
Hey @greghub , are there any updates to this issue? We have the same problems and would like to use this patch. |
The regex check which is currently used to recognise a device is:
This is not sufficient for iOS 13+ because the user agent string no longer contains "iPhone" or "iPad". See this answer: https://stackoverflow.com/a/58065241/5284180
The solution is to update the check to:
I am raising this as an issue because I don't have the time right now to make the actual fix. If someone can pick it up, it would be great.
The text was updated successfully, but these errors were encountered: