AndroidVideoPlayer在線播放視頻,自定義SuperVideoPlayer里面封裝了startPlayVideo()播放視頻
loadAndPlay(String videoUrl, int seekTime)加載并開(kāi)始播放視頻,loadVideo(String videoUrl) 加載視頻,
playVideoAtLastPos()更換清晰度地址時(shí),loadMultipleVideo(ArrayList<Video> allVideo) 播放多個(gè)視頻,等方法
本項(xiàng)目來(lái)源:https://github.com/xiongwei-git/AndroidVideoPlayer
本項(xiàng)目主要代碼:
據(jù)屏幕方向重新設(shè)置播放器的大小
/***
* 旋轉(zhuǎn)屏幕之后回調(diào)
* @param newConfig
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if(null == mSuperVideoPlayer)return;
/***
* 根據(jù)屏幕方向重新設(shè)置播放器的大小
*/
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;
}
}
創(chuàng)新互聯(lián)建站溝通電話:028-86922220,為您提供成都網(wǎng)站建設(shè)網(wǎng)頁(yè)設(shè)計(jì)及定制高端網(wǎng)站建設(shè)服務(wù),創(chuàng)新互聯(lián)建站網(wǎng)頁(yè)制作領(lǐng)域10多年,包括人造霧等多個(gè)領(lǐng)域擁有多年設(shè)計(jì)經(jīng)驗(yàn),選擇創(chuàng)新互聯(lián)建站,為企業(yè)錦上添花。
/***
* 恢復(fù)屏幕至豎屏
*/
private void resetPageToPortrait(){
if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
mSuperVideoPlayer.setPageType(MediaController.PageType.SHRINK);
}
}
AndroidVideoPlayer在線播放視頻
AndroidScreenSlide項(xiàng)目切換view動(dòng)畫(huà)效果
ScrollDownLayout ScrollView和viewpager同事存在的事件處理
StarRatingBar星星切換動(dòng)畫(huà)
AnyShareOfAndroid安卓第三方登錄
AnimCheckBox按鈕點(diǎn)擊動(dòng)畫(huà)效果
android市面主流側(cè)滑框架
PercentageCircle 自定義圓環(huán)效果
EmojiChat聊天頁(yè)面實(shí)現(xiàn),支持發(fā)送失敗重發(fā)
CircularCounter 雙層原形進(jìn)度條效果
網(wǎng)站名稱:AndroidVideoPlayer在線播放視頻
分享路徑:http://aaarwkj.com/article26/phdcjg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開(kāi)發(fā)、、靜態(tài)網(wǎng)站、網(wǎng)站策劃、品牌網(wǎng)站設(shè)計(jì)、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)