Android : Immersive fullscreen in youtubeplayerview not working (YouTube API v3)

on Tuesday, October 14, 2014


I'm developing a video playing app using the latest YouTube API.


In my PlayAll extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener -class


I set: View decorView = getWindow().getDecorView().findViewById(android.R.id.content); decorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY );


My problem is that when playing video the navigation dar does get hidden but doesn't become sticky. Meaning that when touching the screen it will appear again. My intention is to hide it and that the user have to swipe up-down or right hand side to left to reveal it.


The strange thing is that if I leave the app during a video playing and the return to it the immersive mode will work!


What am I doing wrong? Something in the YouTube-classes that breaks my immersive mode?


Thanks! /Jonas


0 comments:

Post a Comment