Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
mini-program-wepy
Commits
5d7865eb
Commit
5d7865eb
authored
Jul 13, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"fix: 问题修复
1、视频切换闪一下;2、swiper不从第一个开始;3、circular改变导致swiper刷 新问题预解决"
parent
1140bf69
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
22 deletions
+25
-22
.eslintcache
.eslintcache
+1
-1
video.wpy
src/components/custom/video.wpy
+24
-21
No files found.
.eslintcache
View file @
5d7865eb
This diff is collapsed.
Click to expand it.
src/components/custom/video.wpy
View file @
5d7865eb
...
...
@@ -5,31 +5,31 @@
duration="500"
circular="{{circular}}"
vertical
current="
1
"
current="
0
"
bindchange="moveSwiper">
<swiper-item wx:for="{{curQueue}}" wx:key="index">
<view class="video-swiper">
<video
class="video-item"
:class="{ show: item.showType && item.showType.value == 2 }"
id="video_{{index}}"
loop
enable-progress-gesture="{{false}}"
show-center-play-btn="{{false}}"
controls="{{false}}"
src="{{
currentIndex == index ?item.videoUrl :nul
l}}"
src="{{
item.videoUr
l}}"
data-id="{{item.id}}"
object-fit="contain"
data-index="{{index}}"
@tap="videoTap"
custom-cache="{{false}}"
wx:if="{{item.showType && item.showType.value ==2}}"
bindplay="loadMedia"
bindloadedmetadata="loadMedia"
>
<video-pause :pause="videoPause"></video-pause>
<van-loading type="spinner" size="40" v-if="videoLoading" custom-class="video-loading"/>
<!--<video-loading v-if="videoLoading" :snapshot="item.videoSnapUrl"/>-->
</video>
<van-loading type="spinner" size="40" v-if="videoLoading" custom-class="video-loading"/>
<!-- <video-loading v-if="videoLoading" :snapshot="item.videoSnapUrl"/> -->
<van-image wx:if="{{item.showType && item.showType.value ==1}}" use-loading-slot src="{{item.photoUrl || item.videoSnapUrl}}" class="images" radius="10rpx" fit="contain" width="100%" height="100%">
<van-loading slot="loading" type="spinner" size="20" vertical/>
</van-image>
...
...
@@ -72,7 +72,7 @@
prevQueue: [],
curQueue: [],
circular: false,
_last: 1,
_last:
-
1,
_invalidUp: 0,
_invalidDown: 0,
_videoContexts: [],
...
...
@@ -214,25 +214,24 @@
circular = false;
}
this.curQueue = [...curQueue];
this.circular = circular;
setTimeout(() => {
this.circular = circular;
}, 600);
},
playCurrent (current) {
this.$nextTick(() => {
if (playTimer) clearTimeout(500);
playTimer = setTimeout(() => {
this.curQueue[current] && this.getProgress(this.curQueue[current].id);
// 滑动到当前元素时,其他video都暂停,只播放当前video
this._videoContexts.forEach(function (ctx, index) {
if (ctx) {
if (index !== current) {
ctx.pause();
} else {
ctx.play();
}
this.curQueue[current] && this.getProgress(this.curQueue[current].id);
// 滑动到当前元素时,其他video都暂停,只播放当前video
this._videoContexts.forEach(function (ctx, index) {
if (ctx) {
if (index !== current) {
ctx.pause();
} else {
ctx.play();
}
}
);
this.updateAwardsInfo(current
);
}, 500
);
}
}
);
this.updateAwardsInfo(current
);
});
},
videoTap(e) {
...
...
@@ -307,6 +306,10 @@
position: absolute;
background-color: #000;
z-index: 1;
display: none;
&.show {
display: block;
}
}
.video-loading {
position: absolute;
...
...
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