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
9b68c936
Commit
9b68c936
authored
Jul 17, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"fix: 首次第二屏视频不播放问题;切换视频后从新开始播放"
parent
37c46f1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
video.wpy
src/components/custom/video.wpy
+8
-1
No files found.
src/components/custom/video.wpy
View file @
9b68c936
...
@@ -77,7 +77,8 @@
...
@@ -77,7 +77,8 @@
_videoContexts: [],
_videoContexts: [],
videoPause: false,
videoPause: false,
showPopup: false,
showPopup: false,
videoLoading: true
videoLoading: true,
isFirstRole: true
},
},
watch: {
watch: {
videoList (list) {
videoList (list) {
...
@@ -144,7 +145,12 @@
...
@@ -144,7 +145,12 @@
// 一次最多只展示3个video标签,提高加载视频的速度
// 一次最多只展示3个video标签,提高加载视频的速度
const current = e.$wx.detail.current;
const current = e.$wx.detail.current;
const diff = current - _last;
const diff = current - _last;
if(this.isFirstRole && current === 1) {
this.playCurrent(1);
this.isFirstRole = false;
}
if (diff === 0) return;
if (diff === 0) return;
this.isFirstRole = false;
this._last = current;
this._last = current;
this.playCurrent(current);
this.playCurrent(current);
// 如果上滑的时候,当前滑动到第0元素,那么被划走,放入prevQueue是第一个元素,这个要自己画图才会更理解
// 如果上滑的时候,当前滑动到第0元素,那么被划走,放入prevQueue是第一个元素,这个要自己画图才会更理解
...
@@ -204,6 +210,7 @@
...
@@ -204,6 +210,7 @@
ctx.play();
ctx.play();
} else {
} else {
ctx.pause();
ctx.pause();
ctx.seek(0);
}
}
}
}
});
});
...
...
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