Why are iOS Tablets not considered ios?

Hello Fellow developers!

Been a while!

Once again I’m having problems with iOS (who would have thought) and especially video playback.

I noticed that for ios I have to use

video.addEventListener('loadedmetadata',function() {
    //do stuff
});

in order to find out if a video is loaded.

Now this only works for me on iOS and I use an if to check if it is an iOS device.

if(pc.platform.ios){
   //Bind the loadedmetadata function
}

But Tablets do not seem to be considered as ‘ios’ devices and the pc.platform.ios returns false.

Anyone got an idea how to handle this ? Can I just bind this method no matter what ?

Thank you

wait we can set our game sto certain platforms in code?

1 Like

This may provide an explanation about why pc.platform.ios is now set to false for iPad with iOS 13:

Maybe the current test for ios should be updated in the PlayCanvas engine source:

Hey,

It seems it’s still the case, on an iPad I got:
console.log("is desktop : " + pc.platform.desktop); true
console.log("is mobile : " + pc.platform.mobile); false
console.log("is iOS : " + pc.platform.ios); false

:confused:

Apple consider iPad OS Safari to be a desktop browser, not mobile now.

https://getupdraft.com/blog/ipados-breaking-changes-developers

There’s little we can do on our side as it’s a desktop browser.

1 Like

I’m personally hesitant on whether we should/shouldn’t cater for this as technically, it is no longer consider to be iOS and is rendering in desktop mode.

Ok, so if Apple says it’s a desktop browser… ok, why not… but perhaps having a property here to know if it’s an iPad platform | PlayCanvas API Reference so we can manage this specific case?

Maybe. The question for me here (and probably some discussion) is whether a device that wants to treat the web as a desktop should be identifiable as an iPad?

Because it uses touch input? Running back into the problem now with using pc.platform.touch which is true on windows. Finally I will made my test against windows because I’m not able to know if it’s an iPad.

Edit windows return false, even if I’m a on windows because I’m in the browser?

This is madness :slight_smile:

Because Apple considers the device to be a desktop device, not an iOS, iPad OS device. Whether it’s using touch or not doesn’t matter.

All the current detection methods for iPadOS are effectively ‘hacks’ because Apple want this to be treated as a desktop browser.