immersive video player
This commit is contained in:
parent
7c0312d721
commit
3cf0f1460b
2 changed files with 20 additions and 1 deletions
|
@ -3,6 +3,7 @@ package asgardius.page.s3manager;
|
|||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import com.google.android.exoplayer2.ExoPlayer;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
|
@ -50,6 +51,22 @@ public class VideoPlayer extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
|
||||
|
||||
View decorView = getWindow().getDecorView();
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
public void onBackPressed() {
|
||||
player.release();
|
||||
finish();
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
<com.google.android.exoplayer2.ui.StyledPlayerView
|
||||
android:id="@+id/player_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
android:keepScreenOn="true"
|
||||
android:padding="0dp"/>
|
||||
|
||||
|
||||
</FrameLayout>
|
Loading…
Reference in a new issue