Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
ImageVideoBanner
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
ImageVideoBanner
Commits
c2231a10
Commit
c2231a10
authored
Nov 16, 2021
by
jiangjiantao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置循环播放需要在开始播放之前
增加一些日志
parent
b6da758b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
AndroidManifest.xml
imageVideoBanner/src/main/AndroidManifest.xml
+11
-11
SampleCoverVideo.java
...va/com/widget/imagevideobanner/view/SampleCoverVideo.java
+3
-1
VideoSubView.java
...n/java/com/widget/imagevideobanner/view/VideoSubView.java
+8
-1
No files found.
imageVideoBanner/src/main/AndroidManifest.xml
View file @
c2231a10
...
@@ -15,18 +15,18 @@
...
@@ -15,18 +15,18 @@
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<activity
<!-- <activity-->
android:name=
".MainActivity"
<!-- android:name=".MainActivity"-->
android:configChanges=
"orientation|keyboardHidden|screenSize|keyboard|navigation"
<!-- android:configChanges="orientation|keyboardHidden|screenSize|keyboard|navigation"-->
android:exported=
"true"
<!-- android:exported="true"-->
android:launchMode=
"singleTask"
<!-- android:launchMode="singleTask"-->
android:screenOrientation=
"portrait"
>
<!-- android:screenOrientation="portrait">--
>
<intent-filter
>
<!-- <intent-filter>--
>
<action
android:name=
"android.intent.action.MAIN"
/
>
<!-- <action android:name="android.intent.action.MAIN" />--
>
<category
android:name=
"android.intent.category.LAUNCHER"
/
>
<!-- <category android:name="android.intent.category.LAUNCHER" />--
>
</intent-filter
>
<!-- </intent-filter>--
>
</activity
>
<!-- </activity>--
>
<activity
<activity
android:name=
".DetailActivity"
android:name=
".DetailActivity"
...
...
imageVideoBanner/src/main/java/com/widget/imagevideobanner/view/SampleCoverVideo.java
View file @
c2231a10
...
@@ -49,10 +49,10 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
...
@@ -49,10 +49,10 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
protected
void
init
(
Context
context
)
{
protected
void
init
(
Context
context
)
{
super
.
init
(
context
);
super
.
init
(
context
);
mCoverImage
=
(
ImageView
)
findViewById
(
R
.
id
.
thumbImage
);
mCoverImage
=
(
ImageView
)
findViewById
(
R
.
id
.
thumbImage
);
if
(
mThumbImageViewLayout
!=
null
&&
if
(
mThumbImageViewLayout
!=
null
&&
(
mCurrentState
==
-
1
||
mCurrentState
==
CURRENT_STATE_NORMAL
||
mCurrentState
==
CURRENT_STATE_ERROR
))
{
(
mCurrentState
==
-
1
||
mCurrentState
==
CURRENT_STATE_NORMAL
||
mCurrentState
==
CURRENT_STATE_ERROR
))
{
mThumbImageViewLayout
.
setVisibility
(
VISIBLE
);
mThumbImageViewLayout
.
setVisibility
(
VISIBLE
);
BLogUtil
.
log
(
"显示封面"
);
}
}
Debuger
.
enable
();
Debuger
.
enable
();
}
}
...
@@ -165,6 +165,7 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
...
@@ -165,6 +165,7 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
super
.
onSurfaceUpdated
(
surface
);
super
.
onSurfaceUpdated
(
surface
);
if
(
mThumbImageViewLayout
!=
null
&&
mThumbImageViewLayout
.
getVisibility
()
==
VISIBLE
)
{
if
(
mThumbImageViewLayout
!=
null
&&
mThumbImageViewLayout
.
getVisibility
()
==
VISIBLE
)
{
mThumbImageViewLayout
.
setVisibility
(
INVISIBLE
);
mThumbImageViewLayout
.
setVisibility
(
INVISIBLE
);
BLogUtil
.
log
(
"隐藏封面"
);
}
}
}
}
...
@@ -181,6 +182,7 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
...
@@ -181,6 +182,7 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
super
.
onSurfaceAvailable
(
surface
);
super
.
onSurfaceAvailable
(
surface
);
if
(
GSYVideoType
.
getRenderType
()
!=
GSYVideoType
.
TEXTURE
)
{
if
(
GSYVideoType
.
getRenderType
()
!=
GSYVideoType
.
TEXTURE
)
{
if
(
mThumbImageViewLayout
!=
null
&&
mThumbImageViewLayout
.
getVisibility
()
==
VISIBLE
)
{
if
(
mThumbImageViewLayout
!=
null
&&
mThumbImageViewLayout
.
getVisibility
()
==
VISIBLE
)
{
BLogUtil
.
log
(
"隐藏封面"
);
mThumbImageViewLayout
.
setVisibility
(
INVISIBLE
);
mThumbImageViewLayout
.
setVisibility
(
INVISIBLE
);
}
}
}
}
...
...
imageVideoBanner/src/main/java/com/widget/imagevideobanner/view/VideoSubView.java
View file @
c2231a10
...
@@ -20,6 +20,7 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
...
@@ -20,6 +20,7 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
private
OnActionFinishListener
mOnPageChangedListener
;
private
OnActionFinishListener
mOnPageChangedListener
;
private
SampleCoverVideo
player
;
private
SampleCoverVideo
player
;
private
MediaBean
mediaBean
;
private
final
GSYSampleCallBack
sampleCallBack
=
new
GSYSampleCallBack
(){
private
final
GSYSampleCallBack
sampleCallBack
=
new
GSYSampleCallBack
(){
@Override
@Override
...
@@ -38,6 +39,7 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
...
@@ -38,6 +39,7 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
public
VideoSubView
(
@NonNull
Context
context
,
MediaBean
mediaBean
,
final
OnActionFinishListener
onPageChangedListener
)
{
public
VideoSubView
(
@NonNull
Context
context
,
MediaBean
mediaBean
,
final
OnActionFinishListener
onPageChangedListener
)
{
super
(
context
);
super
(
context
);
this
.
mediaBean
=
mediaBean
;
mOnPageChangedListener
=
onPageChangedListener
;
mOnPageChangedListener
=
onPageChangedListener
;
View
parent
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
layout_player_view
,
this
,
true
);
View
parent
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
layout_player_view
,
this
,
true
);
player
=
parent
.
findViewById
(
R
.
id
.
player
);
player
=
parent
.
findViewById
(
R
.
id
.
player
);
...
@@ -47,12 +49,17 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
...
@@ -47,12 +49,17 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
player
.
loadCoverImage
(
mediaBean
.
getCover
(),
0
);
player
.
loadCoverImage
(
mediaBean
.
getCover
(),
0
);
player
.
setUp
(
mediaBean
.
getUrl
(),
true
,
null
);
player
.
setUp
(
mediaBean
.
getUrl
(),
true
,
null
);
player
.
setLooping
(
mediaBean
.
isLooping
());
player
.
setLooping
(
mediaBean
.
isLooping
());
BLogUtil
.
log
(
"设置视频轮播是否循环模式="
+
mediaBean
.
isLooping
());
}
}
@Override
@Override
public
void
onActive
()
{
public
void
onActive
()
{
BLogUtil
.
log
(
"视频开始播放"
);
BLogUtil
.
log
(
"视频开始播放"
);
if
(
null
!=
mediaBean
){
// 必须得在播放之前设置循环模式
player
.
setLooping
(
mediaBean
.
isLooping
());
BLogUtil
.
log
(
"设置视频轮播是否循环模式onActive="
+
mediaBean
.
isLooping
());
}
player
.
startPlayLogic
();
player
.
startPlayLogic
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment