Game does not orientated correctly inside iFrame on Cocos Creator 3.4.0

I am using Cocos Creator 3.4.0

I have set the game to run on landscape mode always.
When I rotate the device the game always display in landscape mode.

I have to run the game inside an iFrame.
When I do that the game does not rotate correctly.

I expected the portrait mode to show like this

But it is not working like that.
Can you please suggest a workaround for this?

I can ask engineering to have a look.

@slackmoehrle thank you for your help.

I have investigated this further and I can confirm this is not happening with Cocos Creator 3.3.2

Only happening with the new version 3.4.0

working version link
https://drive.google.com/file/d/1ANvRsBeYIDLXSwgP_ID6uv7LXAbw5SKi/view?usp=sharing

problem version link
https://drive.google.com/file/d/1YPWp71mjr3BYkDkb6JmFTAAWEHO5C97d/view?usp=sharing

can you provide some advice on how to fix this ?

Thanks. I will pass this along to engineering.

image
Hi, the image you uploaded is no longer valid, please re-upload it.
It is not possible to see the specific display requirements.

Hi, I don’t get this phenomenon with the real machine test. It is always displayed in landscape.
3.4.0:


@Koei images are uploaded

I can’t reproduce this problem with my phone, did you test it with your phone?

I have recorded a video showing the issue I have.
https://drive.google.com/file/d/1JH5rKXUrfUawtGcHoVR5grdOza4sOYCy/view?usp=sharing

Can you please have a look?

@Koei may I know whether you running the game inside iFrame?

@Koei any idea what is casing this issue ?

Test with your phone, not with chrome device;
Does this happen to you when you test with your phone?
index2.zip (1008 Bytes)

@Koei thank you for your response.

Our game should be playing inside external iFrame.
It shouldn’t be in our index.html file

Another party will include our game inside their frame work which has iFrame.
And our game plays inside that. We have no control over that iFrame.

The problem is the game works fine in version 3.3.2, not version 3.4.0

sorry,i can’t reproduce it;
you can check this func,the canvas is reset by this function for each rotation.
file path: 340engine\engine\pal\screen-adapter\web\screen-adapter.ts ->> _resizeFrame


ps:
Device Mode can approximate how your site will appear on a mobile device, but to get a complete picture, you need to test your site on a real device. This is because no relevant adaptations have been made to Device Mode.