use of org.schabi.newpipe.player.popup.PopupViewHolder in project NewPipe by TeamNewPipe.
the class PopupVideoPlayer method onCreate.
@Override
public void onCreate() {
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
notificationManager = ((NotificationManager) getSystemService(NOTIFICATION_SERVICE));
internalListener = new InternalListener();
viewHolder = new PopupViewHolder(null);
progressPollRepeater.setRepeatListener(internalListener);
progressPollRepeater.setRepeaterDelay(500);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(PopupVideoPlayer.this);
initReceiver();
}
use of org.schabi.newpipe.player.popup.PopupViewHolder 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