今天就遇到这个问题,疑惑了好久,最后才发现是工具版本问题引起的
2.4.0基础库怎么工具里面video标签播放BUG2.4.0基础库怎么工具里面video播放不了 [图片] 2.3.2下面显示是 [图片]
2018-12-10刚做完这个功能,我的实现方案是:video全屏,与之同层级放一个透明的cover-view,专门处理touch手势进行切换video
小程序美拍的视频切换(类似抖音)如何实现?看了微信开发文档,video不能嵌套在scroll-view,swiper里。 又看了其它大大的提问,好像也不支持touchmove之类的:https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=000c04500f8690584fb60e5c456800&highline=%E6%8A%96%E9%9F%B3 请问短视频的上划切换的类似效果要怎样实现呀?
2018-07-10我今天也正好在处理这个问题。我的video是全屏的,在video同层级放置一个透明的cover去处理touch事件
关于video标签在iOS上touchmove等相关touch事件不生效的问题- 当在video标签上滑动的时候,iOS设备不能检测到滑动事件,相关touch没有执行,而在Android上,是可以完美执行的。为什么在iOS上不开通这个触摸事件呢?
2018-07-10我最近就遇到这个问题,我需要在视频页面,自定义弹窗组件,组件上需要调起分享,我实现方案是: 在最外层用canvas,cover-view和cover-image显示弹窗上的文案和图片,在用按钮绑定open-type="share",设置按钮在页面位置和cover-image一致
cover-view是否应该提供open-type的能力- 需求的场景描述(希望解决的问题) 制作浮层组件 为了覆盖掉所有图层,使用cover-view,例如想要再浮层中提示用户去设置权限,期望点击确定打开权限设置页面,由于cover-view无法嵌套button,wx.openSetting失效的情况下很傻眼 - 希望提供的能力 cover-view提供open-type的能力
2018-07-09你好,请问你这个问题解决了么?怎么解决的
video组件 上下滑动切换视频iphone无效video组件 上下滑动切换视频,安卓显示没问题,iphone无效???怎么解决??iphone上下滑动直接出现背景了! [代码]<[代码][代码]view[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]video[代码] [代码]id[代码][代码]=[代码][代码]"myVideo"[代码] [代码]src[代码][代码]=[代码][代码]"{{url}}"[代码] [代码]controls[代码][代码]=[代码][代码]"{{false}}"[代码] [代码]autoplay[代码][代码]=[代码][代码]"true"[代码] [代码]objectFit[代码][代码]=[代码][代码]"fill"[代码] [代码]bindtouchmove[代码][代码]=[代码][代码]"handletouchmove"[代码] [代码]bindtouchstart[代码][代码]=[代码][代码]"handletouchstart"[代码] [代码]bindtouchend[代码][代码]=[代码][代码]"handletouchend"[代码] [代码]style[代码][代码]=[代码][代码]'top:{{videoheight}}%;'[代码][代码]></[代码][代码]video[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码][代码]page{[代码][代码] [代码][代码]height[代码][代码]: [代码][代码]100%[代码][代码];[代码][代码] [代码][代码]background-color[代码][代码]: [代码][代码]#000[代码][代码];[代码][代码]}[代码][代码]view{[代码][代码] [代码][代码]position[代码][代码]: [代码][代码]absolute[代码][代码];[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]100%[代码][代码]; [代码][代码] [代码][代码]height[代码][代码]: [代码][代码]100%[代码][代码];[代码][代码] [代码][代码]overflow[代码][代码]: [代码][代码]hidden[代码][代码];[代码][代码] [代码][代码]z-index[代码][代码]:[代码][代码]1000[代码][代码];[代码][代码]}[代码][代码]video{[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]100%[代码][代码]; [代码][代码] [代码][代码]height[代码][代码]: [代码][代码]100%[代码][代码];[代码][代码]}[代码][代码]Page({[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]url:[代码][代码]'http://183.56.149.27/vhot2.qqvideo.tc.qq.com/A-aSuPQ2kL0oTeaLLAzX4JDIsc0rjb9G7dY5AYgtEtHY/p0695s87sjw.mp4?sdtfrom=v1010&guid=84bd1b079f916dc8aeb403bb38aeeda4&vkey=D3E47BA1117752D7801052EF47C846DFE72CDFD66A0431CC1F41B8431129DEB73C334747045738B50E90DF8CE2E41110C45190AD77C5B340945AF17A73942DF3E132B8C974441BA0012EF3D7651C5783C14FDFF9327FCAE44B5E9CDA0A6776F52404EA1EFB876DD85D88E35FF83F76F2A3A462C93CDD3777'[代码][代码],[代码][代码] [代码][代码]videoheight:0,[代码][代码] [代码][代码]flag: 0,[代码][代码] [代码][代码]text: [代码][代码]''[代码][代码],[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/*[代码][代码] [代码][代码]滑动[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]handletouchmove: [代码][代码]function[代码] [代码](event){[代码][代码] [代码][代码]if[代码] [代码]([代码][代码]this[代码][代码].data.flag !== 0) {[代码][代码] [代码][代码]return[代码][代码] [代码][代码]}[代码][代码] [代码][代码]let currentX = event.touches[0].pageX;[代码][代码] [代码][代码]let currentY = event.touches[0].pageY;[代码][代码] [代码][代码]let tx = currentX - [代码][代码]this[代码][代码].data.lastX;[代码][代码] [代码][代码]let ty = currentY - [代码][代码]this[代码][代码].data.lastY;[代码][代码] [代码][代码]let text = [代码][代码]""[代码][代码];[代码][代码] [代码][代码]//左右方向滑动 [代码][代码] [代码][代码]if[代码] [代码](Math.abs(tx) > Math.abs(ty)) {[代码][代码] [代码][代码]if[代码] [代码](tx < 0) {[代码][代码] [代码][代码]text = [代码][代码]"向左滑动"[代码][代码];[代码][代码] [代码][代码]this[代码][代码].data.flag = 1;[代码][代码] [代码][代码]}[代码][代码] [代码][代码]else[代码] [代码]if[代码] [代码](tx > 0) {[代码][代码] [代码][代码]text = [代码][代码]"向右滑动"[代码][代码];[代码][代码] [代码][代码]this[代码][代码].data.flag = 2[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]//上下方向滑动 [代码][代码] [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]if[代码] [代码](ty < 0) {[代码][代码] [代码][代码]text = [代码][代码]"向上滑动"[代码][代码];[代码][代码] [代码][代码]this[代码][代码].data.flag = 3[代码][代码] [代码][代码]}[代码][代码] [代码][代码]else[代码] [代码]if[代码] [代码](ty > 0) {[代码][代码] [代码][代码]text = [代码][代码]"向下滑动"[代码][代码];[代码][代码] [代码][代码]this[代码][代码].data.flag = 4[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]console.log(text);[代码][代码] [代码][代码]switch[代码] [代码](text){[代码][代码] [代码][代码]case[代码] [代码]'向上滑动'[代码][代码]:[代码][代码] [代码][代码]this[代码][代码].shang();[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]case[代码] [代码]'向下滑动'[代码][代码]:[代码][代码] [代码][代码]this[代码][代码].xia();[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]case[代码] [代码]'向左滑动'[代码][代码]:[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]case[代码] [代码]'向右滑动'[代码][代码]:[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]//将当前坐标进行保存以进行下一次计算 [代码][代码] [代码][代码]this[代码][代码].data.lastX = currentX;[代码][代码] [代码][代码]this[代码][代码].data.lastY = currentY;[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]text: text,[代码][代码] [代码][代码]}); [代码][代码] [代码][代码]},[代码][代码] [代码][代码]/*[代码][代码] [代码][代码]开始滑动[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]handletouchstart: [代码][代码]function[代码] [代码](event){[代码][代码] [代码][代码]this[代码][代码].data.lastX = event.touches[0].pageX;[代码][代码] [代码][代码]this[代码][代码].data.lastY = event.touches[0].pageY; [代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/*[代码][代码] [代码][代码]滑动完毕[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]handletouchend: [代码][代码]function[代码] [代码](event){[代码][代码] [代码][代码]this[代码][代码].data.flag = 0[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]text: [代码][代码]"没有滑动"[代码][代码],[代码][代码] [代码][代码]});[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/*[代码][代码] [代码][代码]上滑特效[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]shang:[代码][代码]function[代码][代码](){[代码][代码] [代码][代码]console.log([代码][代码]'shang'[代码][代码]);[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]sl = setInterval([代码][代码]function[代码][代码](){[代码][代码] [代码][代码]if[代码] [代码](that.data.videoheight > -100){[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]videoheight: that.data.videoheight - 2[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码]else[代码][代码]{[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]url:[代码][代码]'http://183.56.149.27/vhot2.qqvideo.tc.qq.com/A-aSuPQ2kL0oTeaLLAzX4JDIsc0rjb9G7dY5AYgtEtHY/p0695s87sjw.mp4?sdtfrom=v1010&guid=84bd1b079f916dc8aeb403bb38aeeda4&vkey=D3E47BA1117752D7801052EF47C846DFE72CDFD66A0431CC1F41B8431129DEB73C334747045738B50E90DF8CE2E41110C45190AD77C5B340945AF17A73942DF3E132B8C974441BA0012EF3D7651C5783C14FDFF9327FCAE44B5E9CDA0A6776F52404EA1EFB876DD85D88E35FF83F76F2A3A462C93CDD3777'[代码][代码],[代码][代码] [代码][代码]videoheight:0[代码][代码] [代码][代码]});[代码][代码] [代码][代码]clearInterval(sl);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},1);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/*[代码][代码] [代码][代码]下滑特效[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]xia: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]sl = setInterval([代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]if[代码] [代码](that.data.videoheight < 100) {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]videoheight: that.data.videoheight + 2[代码][代码] [代码][代码]});[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]url: [代码][代码]'http://183.56.149.27/vhot2.qqvideo.tc.qq.com/A-aSuPQ2kL0oTeaLLAzX4JDIsc0rjb9G7dY5AYgtEtHY/p0695s87sjw.mp4?sdtfrom=v1010&guid=84bd1b079f916dc8aeb403bb38aeeda4&vkey=D3E47BA1117752D7801052EF47C846DFE72CDFD66A0431CC1F41B8431129DEB73C334747045738B50E90DF8CE2E41110C45190AD77C5B340945AF17A73942DF3E132B8C974441BA0012EF3D7651C5783C14FDFF9327FCAE44B5E9CDA0A6776F52404EA1EFB876DD85D88E35FF83F76F2A3A462C93CDD3777'[代码][代码],[代码][代码] [代码][代码]videoheight: 0[代码][代码] [代码][代码]});[代码][代码] [代码][代码]clearInterval(sl);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}, 1);[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码](options) {[代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面初次渲染完成[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onReady: [代码][代码]function[代码] [代码]() {[代码][代码] [代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面显示[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onShow: [代码][代码]function[代码] [代码]() {[代码][代码] [代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面隐藏[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onHide: [代码][代码]function[代码] [代码]() {[代码][代码] [代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面卸载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onUnload: [代码][代码]function[代码] [代码]() {[代码][代码] [代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面相关事件处理函数--监听用户下拉动作[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onPullDownRefresh: [代码][代码]function[代码] [代码]() {[代码][代码] [代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面上拉触底事件的处理函数[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onReachBottom: [代码][代码]function[代码] [代码]() {[代码][代码] [代码] [代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 用户点击右上角分享[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onShareAppMessage: [代码][代码]function[代码] [代码]() {[代码][代码] [代码] [代码] [代码][代码]}[代码][代码]})[代码]
2018-07-04你好, 按照你说的,在button组件中添加 一个bindtap事件来跳转到其他页面,我尝试过了,是可以正常跳转,我使用的真机是iPhone8,系统iOS11.4。你遇到卡死,建议你在bindtap事件中设置个延迟1秒再跳转试试,希望能有帮助。
分享后设置跳转其他页面卡死因为无法监听 onShareAppMessage(options)的事件 目前使用,在button组件中添加 一个bindtap事件来跳转到其他页面或者在onShareAppMessage(options)中直接跳转其他页面,但是真机测试时经常出现小程序崩溃情况。请问这是怎么回事,或者说有其他解决方案吗?谢谢。 之前提问过几次都没有得到答复,并且遇见有回复说遇见了相同的情况,望解答。
2018-07-03