use of com.google.android.exoplayer.AspectRatioFrameLayout in project LeafPic by HoraApps.
the class PlayerActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(org.horaapps.leafpic.R.layout.activity_player);
FrameLayout root = (FrameLayout) findViewById(org.horaapps.leafpic.R.id.root);
findViewById(R.id.video_frame).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
toggleControlsVisibility();
}
});
root.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
return !(keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE || keyCode == KeyEvent.KEYCODE_MENU) && mediaController.dispatchKeyEvent(event);
}
});
root.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.md_black_1000));
shutterView = findViewById(org.horaapps.leafpic.R.id.shutter);
videoFrame = (AspectRatioFrameLayout) findViewById(org.horaapps.leafpic.R.id.video_frame);
surfaceView = (SurfaceView) findViewById(org.horaapps.leafpic.R.id.surface_view);
surfaceView.getHolder().addCallback(this);
mediaController = new CustomMediaController(this, this);
mediController_anchor = findViewById(org.horaapps.leafpic.R.id.media_player_anchor);
mediaController.setAnchorView(root);
//mediaController.setPaddingRelative(0,0,0,Measure.getNavBarHeight(PlayerActivity.this));
toolbar = (Toolbar) findViewById(org.horaapps.leafpic.R.id.toolbar);
initUI();
CookieHandler currentHandler = CookieHandler.getDefault();
if (currentHandler != defaultCookieManager)
CookieHandler.setDefault(defaultCookieManager);
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(this, this);
audioCapabilitiesReceiver.register();
}
Aggregations