AndroidVideoPlayer在线播放视频,自定义SuperVideoPlayer里面封装了startPlayVideo()播放视频
loadAndPlay(String videoUrl, int seekTime)加载并开始播放视频,loadVideo(String videoUrl) 加载视频,
playVideoAtLastPos()更换清晰度地址时,loadMultipleVideo(ArrayList<Video> allVideo) 播放多个视频,等方法
本项目来源:https://github.com/xiongwei-git/AndroidVideoPlayer
本项目主要代码:
据屏幕方向重新设置播放器的大小
/***
* 旋转屏幕之后回调
* @param newConfig
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if(null == mSuperVideoPlayer)return;
/***
* 根据屏幕方向重新设置播放器的大小
*/
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().getDecorView().invalidate();
float height = DensityUtil.getWidthInPx(this);
float width = DensityUtil.getHeightInPx(this);
mSuperVideoPlayer.getLayoutParams().height = (int)width;
mSuperVideoPlayer.getLayoutParams().width = (int)height;
} else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
final WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setAttributes(attrs);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
float width = DensityUtil.getWidthInPx(this);
float height = DensityUtil.dip2px(this, 230.f);
mSuperVideoPlayer.getLayoutParams().height = (int)height;
mSuperVideoPlayer.getLayoutParams().width = (int)width;
}
}
创新互联建站沟通电话:028-86922220,为您提供成都网站建设网页设计及定制高端网站建设服务,创新互联建站网页制作领域10多年,包括人造雾等多个领域拥有多年设计经验,选择创新互联建站,为企业锦上添花。
/***
* 恢复屏幕至竖屏
*/
private void resetPageToPortrait(){
if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
mSuperVideoPlayer.setPageType(MediaController.PageType.SHRINK);
}
}
AndroidVideoPlayer在线播放视频
AndroidScreenSlide项目切换view动画效果
ScrollDownLayout ScrollView和viewpager同事存在的事件处理
StarRatingBar星星切换动画
AnyShareOfAndroid安卓第三方登录
AnimCheckBox按钮点击动画效果
android市面主流侧滑框架
PercentageCircle 自定义圆环效果
EmojiChat聊天页面实现,支持发送失败重发
CircularCounter 双层原形进度条效果
网站名称:AndroidVideoPlayer在线播放视频
分享路径:https://www.cdcxhl.com/article26/phdcjg.html
成都网站建设公司_创新互联,为您提供定制开发、、静态网站、网站策划、品牌网站设计、ChatGPT
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联