File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,6 +90,14 @@ const playerConfig: PlayerConfiguration = {
9090 } ,
9191} ;
9292
93+ function updatePresentationModeOnOrientationChange ( player : THEOplayer , orientationType : string ) {
94+ if ( orientationType . startsWith ( 'LANDSCAPE' ) ) {
95+ player . presentationMode = PresentationMode . fullscreen ;
96+ } else if ( orientationType . startsWith ( 'PORTRAIT' ) ) {
97+ player . presentationMode = PresentationMode . inline ;
98+ }
99+ }
100+
93101/**
94102 * The example app demonstrates the use of the THEOplayerView with a custom UI using the provided UI components.
95103 * If you don't want to create a custom UI, you can just use the THEOplayerDefaultUi component instead.
@@ -112,13 +120,7 @@ export default function App() {
112120
113121 useDeviceOrientationChange ( ( orientationType ) => {
114122 if ( player !== undefined && isPhone ) {
115- if ( orientationType . startsWith ( 'LANDSCAPE' ) ) {
116- player . presentationMode = PresentationMode . fullscreen ;
117- } else if ( orientationType . startsWith ( 'PORTRAIT' ) ) {
118- player . presentationMode = PresentationMode . inline ;
119- } else {
120- // keep current presentationMode in other orientations (face up, face down, ...)
121- }
123+ updatePresentationModeOnOrientationChange ( player , orientationType ) ;
122124 }
123125 } ) ;
124126
You can’t perform that action at this time.
0 commit comments