congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MediaPlayerManager.getCurrentVideoView
Code IndexAdd Tabnine to your IDE (free)

How to use
getCurrentVideoView
method
in
org.salient.artplayer.MediaPlayerManager

Best Java code snippets using org.salient.artplayer.MediaPlayerManager.getCurrentVideoView (Showing top 16 results out of 315)

origin: maiwenchang/ArtPlayer

public AbsControlPanel getCurrentControlPanel() {
  VideoView currentVideoView = getCurrentVideoView();
  if (currentVideoView == null) return null;
  return currentVideoView.getControlPanel();
}
origin: maiwenchang/ArtPlayer

/**
 * 拦截返回键
 */
public boolean backPress() {
  Log.i(TAG, "backPress");
  try {
    VideoView currentVideoView = getCurrentVideoView();
    if (currentVideoView != null && currentVideoView.getWindowType() == VideoView.WindowType.FULLSCREEN) {//退出全屏
      currentVideoView.exitFullscreen();
      return true;
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
  return false;
}
origin: maiwenchang/ArtPlayer

@Override
public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i1) {
  if (getCurrentVideoView() == null) return;
  Log.i(TAG, "onSurfaceTextureAvailable [" + "] ");
  if (this.surfaceTexture == null) {
    this.surfaceTexture = surfaceTexture;
    prepare();
  } else {
    textureView.setSurfaceTexture(this.surfaceTexture);
  }
}
origin: maiwenchang/ArtPlayer

private void OpenVolume() {
  try {
    if (mediaPlayer != null) {
      VideoView currentFloor = MediaPlayerManager.instance().getCurrentVideoView();
      if (currentFloor == null) return;
      Context context = currentFloor.getContext();
      if (context == null) return;
      AudioManager audioManager = (AudioManager) context.getSystemService(Service.AUDIO_SERVICE);
      if (audioManager == null) return;
      float streamVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
      float maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
      float volume = streamVolume * 1.000f / maxVolume;
      mediaPlayer.setVolume(volume, volume);
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
}
origin: maiwenchang/ArtPlayer

private void OpenVolume() {
  try {
    if (mediaPlayer != null) {
      VideoView currentFloor = MediaPlayerManager.instance().getCurrentVideoView();
      if (currentFloor == null) return;
      Context context = currentFloor.getContext();
      if (context == null) return;
      AudioManager audioManager = (AudioManager) context.getSystemService(Service.AUDIO_SERVICE);
      if (audioManager == null) return;
      float streamVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
      float maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
      float volume = streamVolume * 1.000f / maxVolume;
      mediaPlayer.setVolume(volume);
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
}
origin: maiwenchang/ArtPlayer

private void OpenVolume() {
  try {
    if (mediaPlayer != null) {
      VideoView currentFloor = MediaPlayerManager.instance().getCurrentVideoView();
      if (currentFloor == null) return;
      Context context = currentFloor.getContext();
      if (context == null) return;
      AudioManager audioManager = (AudioManager) context.getSystemService(Service.AUDIO_SERVICE);
      if (audioManager == null) return;
      float streamVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
      float maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
      float volume = streamVolume * 1.000f / maxVolume;
      mediaPlayer.setVolume(volume, volume);
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
}
origin: maiwenchang/ArtPlayer

  @Override
  public void run() {
    if (MediaPlayerManager.instance().getCurrentVideoView() == mTarget && MediaPlayerManager.instance().isPlaying()) {
      hideUI(layout_bottom, layout_top, start);
    }
  }
};
origin: maiwenchang/ArtPlayer

@Override
protected void onDetachedFromWindow() {
  super.onDetachedFromWindow();
  if (mDetachedListener != null) {
     if (isCurrentPlaying() && this == MediaPlayerManager.instance().getCurrentVideoView()) {
      mDetachedListener.onDetached(this);
    }
  }
}
origin: maiwenchang/ArtPlayer

/**
 * 竖屏
 */
private void onOrientationPortrait() {
  VideoView videoView = MediaPlayerManager.instance().getCurrentVideoView();
  if (videoView != null) {
    if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
      return;
    }
    if ((currentOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
        || currentOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE)
        && !(videoView.getWindowType() == VideoView.WindowType.FULLSCREEN)) {
      currentOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
      return;
    }
    currentOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
    if (mOrientationChangeListener != null) {
      mOrientationChangeListener.onOrientationPortrait(videoView);
    }
  }
}
origin: maiwenchang/ArtPlayer

  @Override
  public void run() {
    if (mPlayerState == PlayerState.PLAYING || mPlayerState == PlayerState.PAUSED) {
      long position = getCurrentPositionWhenPlaying();
      long duration = getDuration();
      int progress = (int) (position * 100 / (duration == 0 ? 1 : duration));
      VideoView currentVideoView = getCurrentVideoView();
      if (currentVideoView == null) return;
      AbsControlPanel controlPanel = currentVideoView.getControlPanel();
      if (controlPanel != null) {
        controlPanel.onProgressUpdate(progress, position, duration);
      }
    }
  }
}
origin: maiwenchang/ArtPlayer

/**
 * 反向横屏(屏幕右边朝上)
 */
private void onOrientationReverseLandscape() {
  VideoView videoView = MediaPlayerManager.instance().getCurrentVideoView();
  if (videoView != null) {
    if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) return;
    if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
        && (videoView.getWindowType() == VideoView.WindowType.FULLSCREEN)) {
      currentOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
      return;
    }
    currentOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
    if (videoView.getWindowType() != VideoView.WindowType.FULLSCREEN) {
      if (mOrientationChangeListener != null) {
        mOrientationChangeListener.onOrientationReverseLandscape(videoView);
      }
    }
  }
}
origin: maiwenchang/ArtPlayer

/**
 * 横屏(屏幕左边朝上)
 */
private void onOrientationLandscape() {
  VideoView videoView = MediaPlayerManager.instance().getCurrentVideoView();
  if (videoView != null) {
    if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) return;
    if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
        && (videoView.getWindowType() == VideoView.WindowType.FULLSCREEN)) {
      currentOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
      return;
    }
    currentOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
    if (videoView.getWindowType() != VideoView.WindowType.FULLSCREEN) {
      if (mOrientationChangeListener != null) {
        mOrientationChangeListener.onOrientationLandscape(videoView);
      }
    }
  }
}
origin: maiwenchang/ArtPlayer

public void updateState(PlayerState playerState) {
  Log.i(TAG, "updateState [" + playerState.name() + "] ");
  mPlayerState = playerState;
  switch (mPlayerState) {
    case PLAYING:
    case PAUSED:
      startProgressTimer();
      break;
    case ERROR:
    case IDLE:
    case PLAYBACK_COMPLETED:
      cancelProgressTimer();
      break;
  }
  VideoView currentFloor = getCurrentVideoView();
  if (currentFloor != null && currentFloor.isCurrentPlaying()) {
    AbsControlPanel controlPanel = currentFloor.getControlPanel();
    if (controlPanel != null) {
      controlPanel.notifyStateChange();//通知当前的控制面板改变布局
    }
  }
}
origin: maiwenchang/ArtPlayer

  @Override
  public void onDetached(VideoView videoView) {
    if (videoView.isCurrentPlaying() && videoView == MediaPlayerManager.instance().getCurrentVideoView()) {
      //开启小窗
      VideoView tinyVideoView = new VideoView(videoView.getContext());
      //set url and data
      tinyVideoView.setUp(videoView.getDataSourceObject(), VideoView.WindowType.TINY, videoView.getData());
      //set control panel
      ControlPanel controlPanel = new ControlPanel(videoView.getContext());
      tinyVideoView.setControlPanel(controlPanel);
      //set cover
      ImageView coverView = controlPanel.findViewById(R.id.video_cover);
      Glide.with(controlPanel.getContext()).load(((VideoBean) videoView.getData()).getImage()).into(coverView);
      //set parent
      tinyVideoView.setParentVideoView(videoView);
      //set LayoutParams
      FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(16 * 45, 9 * 45);
      layoutParams.gravity = Gravity.BOTTOM | Gravity.RIGHT;
      layoutParams.setMargins(0, 0, 30, 100);
      //start tiny window
      tinyVideoView.startTinyWindow(layoutParams);
    }
  }
});
origin: maiwenchang/ArtPlayer

VideoView currentVideoView = MediaPlayerManager.instance().getCurrentVideoView();
if (currentVideoView != null && currentVideoView != this) {
  if (getWindowType() != VideoView.WindowType.TINY) {
origin: maiwenchang/ArtPlayer

  return;
VideoView currentVideoView = MediaPlayerManager.instance().getCurrentVideoView();
if (isCurrentPlaying()) {
org.salient.artplayerMediaPlayerManagergetCurrentVideoView

Javadoc

获得 MediaPlayer 绑定的 VideoView

Popular methods of MediaPlayerManager

  • instance
  • getPlayerState
  • cancelProgressTimer
  • getDuration
  • isMute
  • pause
  • releasePlayerAndView
  • seekTo
  • startProgressTimer
  • getCurrentControlPanel
  • isLooping
  • isPlaying
  • isLooping,
  • isPlaying,
  • onVideoSizeChanged,
  • setScreenScale,
  • updateState,
  • backPress,
  • start,
  • addTextureView,
  • bindAudioFocus

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now