@@ -35,6 +35,7 @@ function App() {
3535 const progress = useVimeoEvent ( player , 'progress' ) ;
3636 const volumeStatus = useVimeoEvent ( player , 'volumechange' ) ;
3737 const playbackRate = useVimeoEvent ( player , 'playbackratechange' ) ;
38+ const fullscreen = useVimeoEvent ( player , 'fullscreenchange' ) ;
3839
3940 const volume = safeNumber ( volumeStatus ?. volume ) ;
4041 const currentTime = safeNumber ( timeupdate ?. seconds ) ;
@@ -124,7 +125,7 @@ function App() {
124125
125126 return (
126127 < SafeAreaView style = { styles . container } >
127- < ScrollView showsVerticalScrollIndicator = { false } >
128+ < ScrollView contentContainerStyle = { styles . contentContainer } showsVerticalScrollIndicator = { false } >
128129 < View style = { styles . header } >
129130 < Text style = { styles . title } > Vimeo Player</ Text >
130131 < Text style = { styles . subtitle } > Video ID: { videoId } </ Text >
@@ -225,6 +226,35 @@ function App() {
225226 </ View >
226227 </ View >
227228
229+ < View style = { styles . fullscreenSection } >
230+ < Text
231+ style = { styles . sectionTitle }
232+ > { `Fullscreen control (${ fullscreen ?. fullscreen ? 'fullscreen' : 'not fullscreen' } )` } </ Text >
233+ < View style = { styles . fullscreenControls } >
234+ < TouchableOpacity
235+ style = { [ styles . button , styles . fullscreenButton ] }
236+ onPress = { async ( ) => {
237+ await player . requestFullscreen ( ) ;
238+
239+ setTimeout ( async ( ) => {
240+ await player . exitFullscreen ( ) ;
241+ } , 3000 ) ;
242+ } }
243+ >
244+ < Text style = { styles . buttonText } > { 'Enter fullscreen (auto-exit in 3s)' } </ Text >
245+ </ TouchableOpacity >
246+
247+ < TouchableOpacity
248+ style = { [ styles . button , styles . fullscreenButton ] }
249+ onPress = { async ( ) => {
250+ await player . exitFullscreen ( ) ;
251+ } }
252+ >
253+ < Text style = { styles . buttonText } > { 'Exit fullscreen' } </ Text >
254+ </ TouchableOpacity >
255+ </ View >
256+ </ View >
257+
228258 < View style = { styles . infoSection } >
229259 < TouchableOpacity style = { [ styles . button , styles . infoButton ] } onPress = { getPlayerInfo } >
230260 < Text style = { styles . buttonText } > 📊 Player info</ Text >
@@ -239,6 +269,10 @@ const styles = StyleSheet.create({
239269 container : {
240270 flex : 1 ,
241271 backgroundColor : '#f5f5f5' ,
272+ paddingBottom : 50 ,
273+ } ,
274+ contentContainer : {
275+ flexGrow : 1 ,
242276 } ,
243277 header : {
244278 padding : 16 ,
@@ -348,7 +382,7 @@ const styles = StyleSheet.create({
348382 volumeButton : {
349383 paddingHorizontal : 12 ,
350384 paddingVertical : 8 ,
351- backgroundColor : '#9E9E9E ' ,
385+ backgroundColor : '#607D8B ' ,
352386 borderRadius : 6 ,
353387 minWidth : 60 ,
354388 } ,
@@ -378,6 +412,25 @@ const styles = StyleSheet.create({
378412 marginBottom : 8 ,
379413 minWidth : 50 ,
380414 } ,
415+ fullscreenSection : {
416+ margin : 16 ,
417+ marginBottom : 8 ,
418+ padding : 16 ,
419+ backgroundColor : '#fff' ,
420+ borderRadius : 8 ,
421+ } ,
422+ fullscreenButton : {
423+ paddingHorizontal : 12 ,
424+ paddingVertical : 8 ,
425+ backgroundColor : '#607D8B' ,
426+ borderRadius : 6 ,
427+ minWidth : 60 ,
428+ } ,
429+ fullscreenControls : {
430+ flexDirection : 'row' ,
431+ justifyContent : 'space-around' ,
432+ flexWrap : 'wrap' ,
433+ } ,
381434 activeButton : {
382435 backgroundColor : '#FF5722' ,
383436 } ,
0 commit comments