收藏
回答

live-player 在iPhone下响应不了bindtap事件

框架类型 问题类型 API/组件名称 终端类型 操作系统 微信版本 基础库版本
小程序 需求 live-player 客户端 iOS 6.6.7 2.0.0

直播组件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>


回答关注问题邀请回答
收藏

3 个回答

  • 2018-08-23

    确实如此 !!直接在live-player   上bindtap 不需要over-view 在iPhone上不响应    6plus

    2018-08-23
    有用
    回复
  • 2018-07-11

    您好。代码片段如下:

    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事件,请解答,谢谢。

    2018-07-11
    有用
    回复
  • 疯狂的小辣椒
    疯狂的小辣椒
    2018-07-10

    麻烦给个完整的能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

    2018-07-10
    有用
    回复
登录 后发表内容