package com.shuyu.gsyvideoplayer.video.base;
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.AttrRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import com.shuyu.gsyvideoplayer.R;
import com.shuyu.gsyvideoplayer.listener.GSYStateUiListener;
import com.shuyu.gsyvideoplayer.listener.GSYVideoProgressListener;
import com.shuyu.gsyvideoplayer.listener.LockClickListener;
import com.shuyu.gsyvideoplayer.utils.CommonUtil;
import com.shuyu.gsyvideoplayer.utils.Debuger;
import java.io.File;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import static com.shuyu.gsyvideoplayer.utils.CommonUtil.hideNavKey;
/**
* 播放UI的显示、控制层、手势处理等
* Created by guoshuyu on 2017/8/2.
*/
public abstract class GSYVideoControlView extends GSYVideoView implements View.OnClickListener, View.OnTouchListener, SeekBar.OnSeekBarChangeListener {
//手指放下的位置
protected long mDownPosition;
//手势调节音量的大小
protected int mGestureDownVolume;
//手势偏差值
protected int mThreshold = 80;
//手动改变滑动的位置
protected long mSeekTimePosition;
//手动滑动的起始偏移位置
protected int mSeekEndOffset;
//退出全屏显示的案件图片
protected int mShrinkImageRes = -1;
//全屏显示的案件图片
protected int mEnlargeImageRes = -1;
//触摸显示后隐藏的时间
protected int mDismissControlTime = 2500;
//触摸的X
protected float mDownX;
//触摸的Y
protected float mDownY;
//移动的Y
protected float mMoveY;
//亮度
protected float mBrightnessData = -1;
//触摸滑动进度的比例系数
protected float mSeekRatio = 1;
//触摸的是否进度条
protected boolean mTouchingProgressBar = false;
//是否改变音量
protected boolean mChangeVolume = false;
//是否改变播放进度
protected boolean mChangePosition = false;
//触摸显示虚拟按键
protected boolean mShowVKey = false;
//是否改变亮度
protected boolean mBrightness = false;
//是否首次触摸
protected boolean mFirstTouch = false;
//是否隐藏虚拟按键
protected boolean mHideKey = true;
//是否需要显示流量提示
protected boolean mNeedShowWifiTip = true;
//是否支持非全屏滑动触摸有效
protected boolean mIsTouchWiget = true;
//是否支持全屏滑动触摸有效
protected boolean mIsTouchWigetFull = true;
//是否点击封面播放
protected boolean mThumbPlay;
//播放错误时,是否点击触发重试
protected boolean mSurfaceErrorPlay = true;
//锁定屏幕点击
protected boolean mLockCurScreen;
//是否需要锁定屏幕
protected boolean mNeedLockFull;
//lazy的setup
protected boolean mSetUpLazy = false;
//seek touch
protected boolean mHadSeekTouch = false;
protected boolean mPostProgress = false;
protected boolean mPostDismiss = false;
protected boolean isShowDragProgressTextOnSeekBar = false;
//播放按键
protected View mStartButton;
//封面
protected View mThumbImageView;
//loading view
protected View mLoadingProgressBar;
//进度条
protected SeekBar mProgressBar;
//全屏按键
protected ImageView mFullscreenButton;
//返回按键
protected ImageView mBackButton;
//锁定图标
protected ImageView mLockScreen;
//时间显示
protected TextView mCurrentTimeTextView, mTotalTimeTextView;
//title
protected TextView mTitleTextView;
//顶部和底部区域
protected ViewGroup mTopContainer, mBottomContainer;
//封面父布局
protected RelativeLayout mThumbImageViewLayout;
//底部进度条
protected ProgressBar mBottomProgressBar;
//点击锁屏的回调
protected LockClickListener mLockClickListener;
protected GSYStateUiListener mGsyStateUiListener;
protected GSYVideoProgressListener mGSYVideoProgressListener;
public GSYVideoControlView(@NonNull Context context) {
super(context);
}
public GSYVideoControlView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public GSYVideoControlView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public GSYVideoControlView(Context context, Boolean fullFlag) {
super(context, fullFlag);
}
protected void init(Context context) {
super.init(context);
mStartButton = findViewById(R.id.start);
mTitleTextView = (TextView) findViewById(R.id.title);
mBackButton = (ImageView) findViewById(R.id.back);
mFullscreenButton = (ImageView) findViewById(R.id.fullscreen);
mProgressBar = (SeekBar) findViewById(R.id.progress);
mCurrentTimeTextView = (TextView) findViewById(R.id.current);
mTotalTimeTextView = (TextView) findViewById(R.id.total);
mBottomContainer = (ViewGroup) findViewById(R.id.layout_bottom);
mTopContainer = (ViewGroup) findViewById(R.id.layout_top);
mBottomProgressBar = (ProgressBar) findViewById(R.id.bottom_progressbar);
mThumbImageViewLayout = (RelativeLayout) findViewById(R.id.thumb);
mLockScreen = (ImageView) findViewById(R.id.lock_screen);
mLoadingProgressBar = findViewById(R.id.loading);
if (isInEditMode())
return;
if (mStartButton != null) {
mStartButton.setOnClickListener(this);
}
if (mFullscreenButton != null) {
mFullscreenButton.setOnClickListener(this);
mFullscreenButton.setOnTouchListener(this);
}
if (mProgressBar != null) {
mProgressBar.setOnSeekBarChangeListener(this);
}
if (mBottomContainer != null) {
mBottomContainer.setOnClickListener(this);
}
if (mTextureViewContainer != null) {
mTextureViewContainer.setOnClickListener(this);
mTextureViewContainer.setOnTouchListener(this);
}
if (mProgressBar != null) {
mProgressBar.setOnTouchListener(this);
}
if (mThumbImageViewLayout != null) {
mThumbImageViewLayout.setVisibility(GONE);
mThumbImageViewLayout.setOnClickListener(this);
}
if (mThumbImageView != null && !mIfCurrentIsFullscreen && mThumbImageViewLayout != null) {
mThumbImageViewLayout.removeAllViews();
resolveThumbImage(mThumbImageView);
}
if (mBackButton != null)
mBackButton.setOnClickListener(this);
if (mLockScreen != null) {
mLockScreen.setVisibility(GONE);
mLockScreen.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mCurrentState == CURRENT_STATE_AUTO_COMPLETE ||
mCurrentState == CURRENT_STATE_ERROR) {
return;
}
lockTouchLogic();
if (mLockClickListener != null) {
mLockClickListener.onClick(v, mLockCurScreen);
}
}
});
}
if (getActi
没有合适的资源?快使用搜索试试~ 我知道了~
视频播放器 IJKplayer、ExoPlayer、MediaPlayer

共526个文件
java:263个
xml:119个
so:30个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 138 浏览量
2023-04-24
09:19:06
上传
评论 1
收藏 78.36MB ZIP 举报
温馨提示
视频播放器(IJKplayer、ExoPlayer、MediaPlayer),HTTPS支持,支持弹幕,支持滤镜、水印、gif截图,片头广告、中间广告,多个同时播放,支持基本的拖动,声音、亮度调节,支持边播边缓存,支持视频本身自带rotation的旋转(90,270之类),重力旋转与手动旋转的同步支持,支持列表播放 ,直接添加控件为封面,列表全屏动画,视频加载速度,列表小窗口支持拖动,动画效果,调整比例,多分辨率切换,支持切换播放器,进度条小窗口预览,其他一些小动画效果,rtsp、concat、mpeg。
资源推荐
资源详情
资源评论























收起资源包目录





































































































共 526 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论


Java程序员-张凯
- 粉丝: 1w+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
