Search in sources :

Example 1 with PopupViewHolder

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();
}
Also used : NotificationManager(android.app.NotificationManager) PopupViewHolder(org.schabi.newpipe.player.popup.PopupViewHolder)

Example 2 with PopupViewHolder

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);
}
Also used : GestureDetector(android.view.GestureDetector) View(android.view.View) EMVideoView(com.devbrackets.android.exomedia.ui.widget.EMVideoView) PopupViewHolder(org.schabi.newpipe.player.popup.PopupViewHolder) WindowManager(android.view.WindowManager) SuppressLint(android.annotation.SuppressLint)

Aggregations

PopupViewHolder (org.schabi.newpipe.player.popup.PopupViewHolder)2 SuppressLint (android.annotation.SuppressLint)1 NotificationManager (android.app.NotificationManager)1 GestureDetector (android.view.GestureDetector)1 View (android.view.View)1 WindowManager (android.view.WindowManager)1 EMVideoView (com.devbrackets.android.exomedia.ui.widget.EMVideoView)1