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?