Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
HTAnticollision
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马乐
HTAnticollision
Commits
a8206caa
Commit
a8206caa
authored
Apr 21, 2023
by
马乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.调整视频播放比例
parent
b0d32270
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
VideoHomeFragment.kt
...a/com/waytous/anticollision/ui/video/VideoHomeFragment.kt
+10
-4
fragment_video_home.xml
app/src/main/res/layout/fragment_video_home.xml
+5
-0
No files found.
app/src/main/java/com/waytous/anticollision/ui/video/VideoHomeFragment.kt
View file @
a8206caa
...
...
@@ -166,17 +166,23 @@ class VideoHomeFragment : Fragment() {
private
fun
initPlayer
()
{
val
uri1
=
Uri
.
fromFile
(
File
(
activity
!!
.
filesDir
,
"飞书20230420-181456.mp4"
))
activity
?.
let
{
binding
.
videoView1
.
player
=
ExoPlayer
.
Builder
(
it
).
build
().
apply
{
val
player1
:
ExoPlayer
?
=
activity
?.
let
{
ExoPlayer
.
Builder
(
it
).
build
().
apply
{
setMediaItem
(
MediaItem
.
Builder
().
setUri
(
uri1
).
build
())
}
}
binding
.
videoView1
.
player
=
player1
player1
?.
prepare
()
val
uri2
=
Uri
.
fromFile
(
File
(
activity
!!
.
filesDir
,
"飞书20230420-181512.mp4"
))
activity
?.
let
{
binding
.
videoView2
.
player
=
ExoPlayer
.
Builder
(
it
).
build
().
apply
{
val
player2
:
ExoPlayer
?
=
activity
?.
let
{
ExoPlayer
.
Builder
(
it
).
build
().
apply
{
setMediaItem
(
MediaItem
.
Builder
().
setUri
(
uri2
).
build
())
}
}
binding
.
videoView2
.
player
=
player2
player2
?.
prepare
()
player1
?.
play
()
player2
?.
play
()
}
override
fun
onDestroyView
()
{
...
...
app/src/main/res/layout/fragment_video_home.xml
View file @
a8206caa
...
...
@@ -115,12 +115,15 @@
android:background=
"@drawable/background_more_btn"
android:clickable=
"true"
android:focusable=
"true"
android:contentDescription=
"@string/toggle_more"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
<com.google.android.exoplayer2.ui.StyledPlayerView
android:id=
"@+id/videoView1"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
app:use_controller=
"false"
app:resize_mode=
"fill"
app:layout_constraintStart_toStartOf=
"@id/guideline2"
app:layout_constraintBottom_toBottomOf=
"@id/guideline3"
app:layout_constraintTop_toTopOf=
"parent"
...
...
@@ -129,6 +132,8 @@
android:id=
"@+id/videoView2"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
app:use_controller=
"false"
app:resize_mode=
"fill"
app:layout_constraintStart_toStartOf=
"@id/guideline2"
app:layout_constraintTop_toTopOf=
"@id/guideline3"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
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