Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
Project
Project
Details
Activity
Releases
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
android
uniapp_vedio
Commits
98817b0e
Commit
98817b0e
authored
Nov 13, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化自动播放
parent
9af139b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
30 deletions
+33
-30
recommendVideo.vue
vedio/pages/recommend/recommendVideo.vue
+1
-1
newVideoDetail.vue
vedio/pagesC/video/newVideoDetail.vue
+32
-29
No files found.
vedio/pages/recommend/recommendVideo.vue
View file @
98817b0e
...
...
@@ -127,7 +127,7 @@
}
},
stop
()
{
audo
.
pause
()
//
audo.pause()
this
.
videoContext
?.
pause
()
},
queryList
()
{
...
...
vedio/pagesC/video/newVideoDetail.vue
View file @
98817b0e
...
...
@@ -4,10 +4,10 @@
<swiper
class=
"swiper"
circular
@
change=
"swiperChange"
:current=
"current"
:vertical=
"true"
>
<swiper-item
v-for=
"(list, index) in displaySwiperList"
:key=
"index"
:style=
"'width:100%; height:100%;'"
>
<view
:style=
"'width:100%; height:100%;'"
>
<video
v-if=
"Math.abs(displayIndex-index)==0 && list.vedioUrl"
:id=
"list.vedioI
d
"
<video
v-if=
"Math.abs(displayIndex-index)==0 && list.vedioUrl"
:id=
"list.vedioI
ndex
"
:controls=
"controls"
:loop=
"!isplay"
:enable-progress-gesture=
"false"
:show-loading=
"true"
:show-fullscreen-btn=
"false"
@
ended=
"ended"
@
controlstoggle=
"controlstoggle"
@
click=
"tapVides()"
@
timeupdate=
"timeupdate"
style=
"width:100%; height:100%;background: #f56c6c;"
@
timeupdate=
"timeupdate"
style=
"width:100%; height:100%;background: #f56c6c;"
:autoplay=
"true"
:src=
"list.vedioUrl"
:poster=
"data.coverImage"
class=
"tsvideo"
play-btn-position=
"center"
object-fit=
"contain"
/>
<view
v-if=
"!isqp"
class=
"userInfo"
>
...
...
@@ -132,7 +132,6 @@
ref
}
from
"vue"
;
let
audo
=
uni
.
createInnerAudioContext
()
export
default
{
name
:
"newVideoDetail"
,
mixins
:
[
common
],
...
...
@@ -193,12 +192,10 @@
onShow
()
{
// 从VIP页面返回关闭弹框
this
.
down
()
// this.getData()
},
methods
:
{
paySuccess
()
{
this
.
unlock
(
this
.
originIndex
)
// this.getData()
},
showPayDialog
()
{
let
isIOS
=
wx
.
getSystemInfoSync
().
platform
;
...
...
@@ -222,13 +219,18 @@
timeupdate
(
event
)
{
// 自动播放下一集
if
(
event
.
detail
.
currentTime
>
0
&&
this
.
originList
[
this
.
originIndex
].
lock
)
{
uni
.
createVideoContext
(
''
+
this
.
originList
[
this
.
originIndex
].
vedioI
d
,
this
).
seek
(
0
);
uni
.
createVideoContext
(
''
+
this
.
originList
[
this
.
originIndex
].
vedioI
d
,
this
).
pause
();
uni
.
createVideoContext
(
''
+
this
.
originList
[
this
.
originIndex
].
vedioI
ndex
,
this
).
seek
(
0
);
uni
.
createVideoContext
(
''
+
this
.
originList
[
this
.
originIndex
].
vedioI
ndex
,
this
).
pause
();
this
.
unlock
(
this
.
originIndex
)
}
},
selectThisVideo
(
index
)
{
this
.
down
();
if
(
this
.
originIndex
==
index
)
{
return
}
this
.
oid
=
this
.
originIndex
this
.
duration
=
20
;
this
.
originIndex
=
index
this
.
initSwiperData
(
this
.
originIndex
);
...
...
@@ -276,26 +278,29 @@
if
(
data
.
code
==
200
)
{
that
.
originList
[
that
.
originIndex
].
lock
=
false
setTimeout
(()
=>
{
uni
.
createVideoContext
(
''
+
that
.
originList
[
that
.
originIndex
].
vedioId
,
uni
.
createVideoContext
(
''
+
that
.
originList
[
that
.
originIndex
]
.
vedioIndex
,
that
)
.
play
();
th
is
.
commitVideo
()
th
at
.
commitVideo
()
},
500
)
}
else
if
(
data
.
code
==
301
)
{
that
.
originList
[
that
.
originIndex
].
lock
=
false
setTimeout
(()
=>
{
uni
.
createVideoContext
(
''
+
that
.
originList
[
that
.
originIndex
].
vedioId
,
uni
.
createVideoContext
(
''
+
that
.
originList
[
that
.
originIndex
]
.
vedioIndex
,
that
)
.
play
();
th
is
.
commitVideo
()
th
at
.
commitVideo
()
},
500
)
}
else
if
(
data
.
code
==
302
)
{
that
.
originList
[
that
.
originIndex
].
lock
=
false
setTimeout
(()
=>
{
uni
.
createVideoContext
(
''
+
that
.
originList
[
that
.
originIndex
].
vedioId
,
uni
.
createVideoContext
(
''
+
that
.
originList
[
that
.
originIndex
]
.
vedioIndex
,
that
)
.
play
();
th
is
.
commitVideo
()
th
at
.
commitVideo
()
},
500
)
}
else
if
(
data
.
code
==
303
)
{
that
.
showPayDialog
()
...
...
@@ -304,6 +309,7 @@
});
},
getData
()
{
let
that
=
this
this
.
originList
=
[]
this
.
post
({
url
:
'/vedio/getIndexList'
,
...
...
@@ -314,18 +320,18 @@
success
:
({
data
})
=>
{
th
is
.
originList
=
data
.
list
if
(
th
is
.
isPlayNext
==
1
)
{
th
is
.
originIndex
=
this
.
data
.
recommendIndex
-
1
th
at
.
originList
=
data
.
list
if
(
th
at
.
isPlayNext
==
1
)
{
th
at
.
originIndex
=
that
.
data
.
recommendIndex
-
1
}
else
{
th
is
.
originIndex
=
this
.
data
.
seeIndex
-
1
th
at
.
originIndex
=
that
.
data
.
seeIndex
-
1
}
if
(
th
is
.
originIndex
>=
this
.
data
.
vedioTotal
||
this
.
originIndex
<
0
)
{
th
is
.
originIndex
=
0
if
(
th
at
.
originIndex
>=
that
.
data
.
vedioTotal
||
that
.
originIndex
<
0
)
{
th
at
.
originIndex
=
0
}
th
is
.
data
=
data
.
vedioMsg
th
is
.
initSwiperData
(
this
.
originIndex
);
th
is
.
initEpisode
()
th
at
.
data
=
data
.
vedioMsg
th
at
.
initSwiperData
(
that
.
originIndex
);
th
at
.
initEpisode
()
}
});
},
...
...
@@ -359,8 +365,6 @@
];
this
.
displaySwiperList
=
displayList
;
// audo.pause()
if
(
this
.
oid
>=
this
.
originList
.
length
)
{
this
.
oid
=
0
}
...
...
@@ -368,15 +372,14 @@
this
.
oid
=
this
.
originList
.
length
-
1
}
console
.
log
(
'++++++++++++上一条播放数据 Index:'
,
this
.
oid
)
// uni.createVideoContext('' + this.originList[this.oid].vedioId, this).stop();
uni
.
createVideoContext
(
''
+
this
.
originList
[
this
.
oid
].
vedioId
,
this
).
pause
();
uni
.
createVideoContext
(
''
+
this
.
originList
[
this
.
oid
].
vedioIndex
,
this
).
pause
();
if
(
this
.
originList
[
originIndex
].
lock
)
{
this
.
unlock
(
this
.
originIndex
)
}
else
{
setTimeout
(()
=>
{
// audo.play()
uni
.
createVideoContext
(
''
+
this
.
originList
[
originIndex
].
vedioI
d
,
this
).
play
();
uni
.
createVideoContext
(
''
+
this
.
originList
[
originIndex
].
vedioI
ndex
,
this
).
play
();
this
.
commitVideo
()
},
500
)
}
...
...
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