Make YouTube component enter into full screen mode when device orientation is changed

What I am trying to do:
I have a youtube player component. I would like to make it fullscreen when the user changes the device orientation to landscape.

What I am stuck at:
Looking at the screen orientation options, I saw many options like full sensor, sensor landscape, etc. (What are all these? Can anyone explain?)

What I tried to do
I know about the ‘Screen Orientation Changed’ component, but I don’t know how to trigger it. When Ii use it, the youtube component goes into fullscreen mode when the device orientation is changed into landscape, but it stays in fullscreen mode after switching to portrait orientation.

Any idea how to do this properly?

PS: Kodular really needs to work on its documentation. We really need it.

Here’s some info on screen orientations

Screen Orientation

[ Getter + Setter ]
Type: Text

The orientation of the screen, specified as a text value.

Options
Behind The screen is displayed in the same orientation as the previously open screen.
Full Sensor The screen is rotated based on how the user moves the device.
Landscape The screen is shown wider than it is tall.
No Sensor The screen stops using the device’s sensor data to orient itself.
Portrait The screen is shown taller than it is wide.
Reverse Landscape The screen is shown wider than it is tall, and is flipped along the longer axis.
Reverse Portrait The screen is shown taller than it is wide, and is flipped along the longer axis.
Sensor The screen uses the device’s sensor data to orient itself, ignoring the user’s request to turn off sensor-based orientation.
Sensor Landscape The screen is shown wider than it is tall, and the direction of the display can be changed with the device’s sensor.
Sensor Portrait The screen is shown taller than it is wide, and the direction of the display can be changed with the device’s sensor.
Unspecified The screen lets the system decide the best orientation.
User The screen is oriented as per the user’s settings.
1 Like

Hey I have make a guide on this maybe it can help you.

try this: Youtube Player Fullscreen

Thank You!!:blush:

Thank you so much! It worked! Can you explain how you made it work with screen height and screen width?

I made it work with the help of screen orientation changed block and when Youtube_Player.Fullscreen Do block.

Yes, but how do the screen height & width change when orientation is changed?

Screen Width and Height automatically changes when someone change the orientation. It’s by default.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.