Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
R
RTSPDemo
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ubains-android-demo
RTSPDemo
Commits
474815a7
提交
474815a7
authored
11月 06, 2019
作者:
汪显鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GSY 多任务播放模式
上级
76b9e47d
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
151 行增加
和
297 行删除
+151
-297
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+7
-6
EmptyActivity.java
app/src/main/java/com/ubains/rtspdemo/EmptyActivity.java
+4
-3
MutliActivity.java
app/src/main/java/com/ubains/rtspdemo/MutliActivity.java
+81
-100
ListMultiNormalAdapter.java
...ava/com/ubains/rtspdemo/vedio/ListMultiNormalAdapter.java
+7
-7
MultiSampleVideo.java
...main/java/com/ubains/rtspdemo/vedio/MultiSampleVideo.java
+8
-19
activity_mutli.xml
app/src/main/res/layout/activity_mutli.xml
+40
-10
video_layout_cover.xml
app/src/main/res/layout/video_layout_cover.xml
+4
-152
没有找到文件。
app/src/main/AndroidManifest.xml
浏览文件 @
474815a7
...
...
@@ -6,6 +6,7 @@
<application
android:allowBackup=
"true"
android:appComponentFactory=
""
android:hardwareAccelerated=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
...
...
@@ -19,6 +20,10 @@
android:screenOrientation=
"landscape"
android:theme=
"@style/Theme.AppCompat.NoActionBar"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
...
...
@@ -28,18 +33,14 @@
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:screenOrientation=
"landscape"
android:theme=
"@style/Theme.AppCompat.NoActionBar"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".EmptyActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:screenOrientation=
"landscape"
android:theme=
"@style/Theme.AppCompat.NoActionBar"
>
</activity>
android:theme=
"@style/Theme.AppCompat.NoActionBar"
></activity>
<activity
android:name=
".MainActivity"
...
...
app/src/main/java/com/ubains/rtspdemo/EmptyActivity.java
浏览文件 @
474815a7
...
...
@@ -20,6 +20,8 @@ import com.ubains.rtspdemo.vedio.EmptyControlVideo;
import
java.util.ArrayList
;
import
java.util.List
;
import
tv.danmaku.ijk.media.exo2.Exo2PlayerManager
;
import
tv.danmaku.ijk.media.exo2.ExoPlayerCacheManager
;
import
tv.danmaku.ijk.media.player.IjkMediaPlayer
;
public
class
EmptyActivity
extends
AppCompatActivity
{
...
...
@@ -49,7 +51,7 @@ public class EmptyActivity extends AppCompatActivity {
}
private
void
init
()
{
//
PlayerFactory.setPlayManager(Exo2PlayerManager.class);
PlayerFactory
.
setPlayManager
(
Exo2PlayerManager
.
class
);
//系统内核模式
//PlayerFactory.setPlayManager(SystemPlayerManager.class);
//ijk内核,默认模式 ijk 模式才支持RTSP 播放
...
...
@@ -100,10 +102,9 @@ public class EmptyActivity extends AppCompatActivity {
String
url
=
"rtsp://admin:huawei@123@192.168.11.20/LiveMedia/ch1/Media1"
;
String
ur2
=
"rtsp://admin:huawei@123@192.168.11.20/LiveMedia/ch1/Media1"
;
videoPlayer1
.
setUp
(
url
,
true
,
""
);
videoPlayer2
.
setUp
(
ur2
,
true
,
""
);
//
videoPlayer2.setUp(ur2, true, "");
//过渡动画
initTransition
();
...
...
app/src/main/java/com/ubains/rtspdemo/MutliActivity.java
浏览文件 @
474815a7
此差异已折叠。
点击以展开。
app/src/main/java/com/ubains/rtspdemo/vedio/ListMultiNormalAdapter.java
浏览文件 @
474815a7
...
...
@@ -66,9 +66,9 @@ public class ListMultiNormalAdapter extends BaseAdapter {
}
//
final String url = "http://9890.vod.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4";
final
String
url
=
"http://9890.vod.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4"
;
final
String
url
=
"rtsp://admin:huawei@123@192.168.11.21/LiveMedia/ch1/Media1"
;
//
final String url = "rtsp://admin:huawei@123@192.168.11.21/LiveMedia/ch1/Media1";
//多个播放时必须在setUpLazy、setUp和getGSYVideoManager()等前面设置
holder
.
gsyVideoPlayer
.
setPlayTag
(
TAG
);
...
...
@@ -101,11 +101,11 @@ public class ListMultiNormalAdapter extends BaseAdapter {
holder
.
gsyVideoPlayer
.
setNeedLockFull
(
true
);
if
(
position
%
2
==
0
)
{
holder
.
gsyVideoPlayer
.
loadCoverImage
(
url
,
R
.
mipmap
.
ic_launcher
);
}
else
{
holder
.
gsyVideoPlayer
.
loadCoverImage
(
url
,
R
.
mipmap
.
ic_launcher
);
}
//
if (position % 2 == 0) {
//
holder.gsyVideoPlayer.loadCoverImage(url, R.mipmap.ic_launcher);
//
} else {
//
holder.gsyVideoPlayer.loadCoverImage(url, R.mipmap.ic_launcher);
//
}
holder
.
gsyVideoPlayer
.
setVideoAllCallBack
(
new
GSYSampleCallBack
()
{
...
...
app/src/main/java/com/ubains/rtspdemo/vedio/MultiSampleVideo.java
浏览文件 @
474815a7
...
...
@@ -24,7 +24,7 @@ public class MultiSampleVideo extends StandardGSYVideoPlayer {
private
final
static
String
TAG
=
"MultiSampleVideo"
;
ImageView
mCoverImage
;
//
ImageView mCoverImage;
String
mCoverOriginUrl
;
...
...
@@ -45,7 +45,7 @@ public class MultiSampleVideo extends StandardGSYVideoPlayer {
@Override
protected
void
init
(
Context
context
)
{
super
.
init
(
context
);
mCoverImage
=
(
ImageView
)
findViewById
(
R
.
id
.
thumbImage
);
//
mCoverImage = (ImageView) findViewById(R.id.thumbImage);
if
(
mThumbImageViewLayout
!=
null
&&
(
mCurrentState
==
-
1
||
mCurrentState
==
CURRENT_STATE_NORMAL
||
mCurrentState
==
CURRENT_STATE_ERROR
))
{
mThumbImageViewLayout
.
setVisibility
(
VISIBLE
);
...
...
@@ -101,28 +101,17 @@ public class MultiSampleVideo extends StandardGSYVideoPlayer {
return
R
.
layout
.
video_layout_cover
;
}
public
void
loadCoverImage
(
String
url
,
int
res
)
{
mCoverOriginUrl
=
url
;
mDefaultRes
=
res
;
mCoverImage
.
setBackgroundResource
(
res
);
// Glide.with(getContext().getApplicationContext())
// .setDefaultRequestOptions(
// new RequestOptions()
// .frame(1000000)
// .centerCrop()
// .error(res)
// .placeholder(res))
// .load(url)
// .into(mCoverImage);
}
// public void loadCoverImage(String url, int res) {
// mCoverOriginUrl = url;
// mDefaultRes = res;
// mCoverImage.setBackgroundResource(res);
// }
@Override
public
GSYBaseVideoPlayer
startWindowFullscreen
(
Context
context
,
boolean
actionBar
,
boolean
statusBar
)
{
GSYBaseVideoPlayer
gsyBaseVideoPlayer
=
super
.
startWindowFullscreen
(
context
,
actionBar
,
statusBar
);
MultiSampleVideo
multiSampleVideo
=
(
MultiSampleVideo
)
gsyBaseVideoPlayer
;
multiSampleVideo
.
loadCoverImage
(
mCoverOriginUrl
,
mDefaultRes
);
//
multiSampleVideo.loadCoverImage(mCoverOriginUrl, mDefaultRes);
return
multiSampleVideo
;
}
...
...
app/src/main/res/layout/activity_mutli.xml
浏览文件 @
474815a7
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".MutliActivity"
>
<LinearLayout
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<com.ubains.rtspdemo.vedio.MultiSampleVideo
android:layout_weight=
"1"
android:id=
"@+id/
detail_player
1"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/
ll_rtsp
1"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<com.ubains.rtspdemo.vedio.MultiSampleVideo
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:id=
"@+id/detail_player2"
android:orientation=
"vertical"
>
<com.ubains.rtspdemo.vedio.MultiSampleVideo
android:id=
"@+id/detail_player1"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
/>
<com.ubains.rtspdemo.vedio.MultiSampleVideo
android:id=
"@+id/detail_player3"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_rtsp2"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<com.ubains.rtspdemo.vedio.MultiSampleVideo
android:id=
"@+id/detail_player2"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
/>
<com.ubains.rtspdemo.vedio.MultiSampleVideo
android:id=
"@+id/detail_player4"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/video_layout_cover.xml
浏览文件 @
474815a7
...
...
@@ -4,160 +4,12 @@
android:layout_height=
"match_parent"
android:background=
"@android:color/black"
>
<ImageView
android:id=
"@+id/back_tiny"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_marginLeft=
"6dp"
android:layout_marginTop=
"6dp"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/small_close"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:paddingLeft=
"10dp"
android:paddingTop=
"10dp"
android:scaleType=
"centerInside"
android:src=
"@drawable/video_small_close"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/lock_screen"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"50dp"
android:scaleType=
"centerInside"
android:src=
"@drawable/unlock"
android:visibility=
"gone"
/>
<LinearLayout
android:id=
"@+id/layout_bottom"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_alignParentBottom=
"true"
android:background=
"#99000000"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:visibility=
"invisible"
>
<ImageView
android:id=
"@+id/fullscreen"
android:layout_width=
"wrap_content"
android:layout_height=
"fill_parent"
android:paddingRight=
"16dp"
android:scaleType=
"center"
android:src=
"@drawable/video_enlarge"
/>
<SeekBar
android:id=
"@+id/progress"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1.0"
android:background=
"@null"
android:max=
"100"
android:maxHeight=
"4dp"
android:minHeight=
"4dp"
android:paddingTop=
"8dp"
android:paddingBottom=
"8dp"
android:progressDrawable=
"@drawable/video_seek_progress"
android:thumb=
"@drawable/video_seek_thumb"
/>
<TextView
android:id=
"@+id/total"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"16dp"
android:text=
"00:00"
android:textColor=
"#ffffff"
/>
<TextView
android:id=
"@+id/current"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"16dp"
android:text=
"00:00"
android:textColor=
"#ffffff"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/layout_top"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:background=
"@drawable/video_title_bg"
android:gravity=
"center_vertical"
>
<ImageView
android:id=
"@+id/back"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:paddingLeft=
"10dp"
android:scaleType=
"centerInside"
android:src=
"@drawable/video_back"
/>
<TextView
android:id=
"@+id/title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingLeft=
"10dp"
android:textColor=
"@android:color/white"
android:textSize=
"18sp"
/>
</LinearLayout>
<ProgressBar
android:id=
"@+id/bottom_progressbar"
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"match_parent"
android:layout_height=
"1.5dp"
android:layout_alignParentBottom=
"true"
android:max=
"100"
android:progressDrawable=
"@drawable/video_progress"
/>
<RelativeLayout
<FrameLayout
android:id=
"@+id/surface_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
></RelativeLayout>
<RelativeLayout
android:id=
"@+id/thumb"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentStart=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentBottom=
"true"
android:background=
"#000000"
android:scaleType=
"fitCenter"
>
<ImageView
android:id=
"@+id/thumbImage"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scaleType=
"centerCrop"
/>
</RelativeLayout>
<moe.codeest.enviews.ENDownloadView
android:id=
"@+id/loading"
android:layout_width=
"28dp"
android:layout_height=
"28dp"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:visibility=
"invisible"
/>
android:gravity=
"center"
>
</FrameLayout>
<moe.codeest.enviews.ENPlayView
android:id=
"@+id/start"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_vertical"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论