直播组件live-player添加bindtap事件在Android中可以响应,在iPhone响应不了,代码如下:
<live-player id="livePlay" src="{{watchUrl == undefined ? '' : watchUrl}}" mode="RTC" autoplay="autoplay" bindstatechange="statechange" data-id="{{watchId}}" bindtap='touchBottom'>
<cover-view class='player_bottom' animation="{{animationData}}" wx:if="{{showModalplayer}}">
<cover-view class='player-play' bindtap="play" wx:if='{{!playindexFlag}}'>
<cover-image src='/static/images/icon/play.png' />
</cover-view>
<cover-view class='player-pause' bindtap="pause" wx:if='{{playindexFlag}}'>
<cover-image src='/static/images/icon/pause.png' />
</cover-view>
<cover-view class='player-right' bindtap="showFullScreen">
<cover-image wx:if="{{livePlayFlag1}}" src='/static/images/icon/all_big.png' />
</cover-view>
<cover-view class='player-right' bindtap="exitFullScreen">
<cover-image wx:if="{{livePlayFlag2}}" src='/static/images/icon/all.png'></cover-image>
</cover-view>
</cover-view>
</live-player>
确实如此 !!直接在live-player 上bindtap 不需要over-view 在iPhone上不响应 6plus
您好。代码片段如下:
wxml—>
<view class='video-box'>
<live-player id="livePlay" src="{{watchUrl == undefined ? '' : watchUrl}}" mode="RTC" autoplay="autoplay" bindtap="touchBottom" data-id="{{watchId}}" >
<cover-view class='player_bottom' animation="{{animationData}}" wx:if="{{showModalplayer}}">
<cover-view class='player-play' bindtap="play" wx:if='{{!playindexFlag}}'>
<cover-image src='/static/images/icon/play.png' />
</cover-view>
<cover-view class='player-pause' bindtap="pause" wx:if='{{playindexFlag}}'>
<cover-image src='/static/images/icon/pause.png' />
</cover-view>
<cover-view class='player-right' bindtap="showFullScreen">
<cover-image wx:if="{{livePlayFlag1}}" src='/static/images/icon/all_big.png' />
</cover-view>
<cover-view class='player-right' bindtap="exitFullScreen">
<cover-image wx:if="{{livePlayFlag2}}" src='/static/images/icon/all.png'></cover-image>
</cover-view>
</cover-view>
</live-player>
</view>
live-player添加了一个bindtap的touchBottom事件,在js触发
js—>
touchBottom: function () {
var that = this;
var animation = wx.createAnimation({
duration: 200,
timingFunction: "linear",
delay: 0
})
that.animation = animation
animation.translateY(300).step()
that.setData({
animationData: animation.export(),
showModalplayer: true
});
animation.translateY(0).step()
that.setData({
animationData: animation.export(),
});
},
我意在直播通过touchBottom事件弹出cover-view层,但是点击时无法响应touchBottom事件,请解答,谢谢。
麻烦给个完整的能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)