Mudu.Room.Player 播放器

由于小程序里只能使用小程序提供的video组件,所以Mudu.Room.Player仅提供了对用户播放时长的统计功能。 只需要在小程序的事件处理中执行相应函数即可。

video组件bindplay时调用

Mudu.Room.Player.OnPlay()

video组件bindpause时调用

Mudu.Room.Player.OnPause()

video组件bindended时调用

Mudu.Room.Player.OnEnded()

Page组件onHide时调用

Mudu.Room.Player.OnPageHide()

Page组件onUnload时调用

Mudu.Room.Player.OnPageUnload()

例子

<!-- example.wxml -->

<video
    src="http://www.quad-band-phones.com/483/xxx"
    bindplay="onPlay"
    bindpause="onPause"
    bindended="onEnded"
>

// example.js
Page({
    onPlay () {
        Mudu.Room.Player.OnPlay()
    },
    onPause () {
        Mudu.Room.Player.OnPause()
    },
    onEnded () {
        Mudu.Room.Player.OnEnded()
    },
    onHide () {
        Mudu.Room.Player.OnPageHide()
    },
    onUnload () {
        Mudu.Room.Player.OnPageUnload()
    }
})

results matching ""

    No results matching ""