use of com.devbrackets.android.exomedia.ui.widget.EMVideoView in project NewPipe by TeamNewPipe.
the class PopupVideoPlayer method initPopup.
@SuppressLint({ "RtlHardcoded" })
private void initPopup() {
if (DEBUG)
Log.d(TAG, "initPopup() called");
View rootView = View.inflate(this, R.layout.player_popup, null);
viewHolder = new PopupViewHolder(rootView);
viewHolder.getPlaybackSeekBar().setOnSeekBarChangeListener(internalListener);
emVideoView = viewHolder.getVideoView();
emVideoView.setOnPreparedListener(internalListener);
emVideoView.setOnCompletionListener(internalListener);
emVideoView.setOnErrorListener(internalListener);
emVideoView.setOnSeekCompletionListener(internalListener);
windowLayoutParams = new WindowManager.LayoutParams((int) getMinimumVideoWidth(currentPopupHeight), (int) currentPopupHeight, WindowManager.LayoutParams.TYPE_PHONE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
windowLayoutParams.gravity = Gravity.LEFT | Gravity.TOP;
MySimpleOnGestureListener listener = new MySimpleOnGestureListener();
gestureDetector = new GestureDetector(this, listener);
gestureDetector.setIsLongpressEnabled(false);
rootView.setOnTouchListener(listener);
updateScreenSize();
windowManager.addView(rootView, windowLayoutParams);
}
Aggregations