求教视频播放完毕的回调函数写法

请问官方文档中的这个方法二,如果想改成视频播放结束后触发,应该吧"ready-to-play"改成什么啊,求指教,谢谢

方法二

通过 videoplayer.node.on(‘ready-to-play’, …) 的方式来添加

//假设我们在一个组件的 onLoad 方法里面添加事件处理回调,在 callback 函数中进行事件处理:

cc.Class({
extends: cc.Component,

properties: {
   videoplayer: cc.VideoPlayer
},

onLoad: function () {
   this.videoplayer.node.on('ready-to-play', this.callback, this);
},

callback: function (event) {
   //这里的 event 是一个 EventCustom 对象,你可以通过 event.detail 获取 VideoPlayer 组件
   var videoplayer = event.detail;
   //do whatever you want with videoplayer
   //另外,注意这种方式注册的事件,也无法传递 customEventData
}

});
同样的,你也可以注册 ‘meta-loaded’, ‘clicked’ , ‘playing’ 等事件,这些事件的回调函数的参数与 ‘read-to-play’ 的参数一致。

ready-to-play 改成 completed
可以去查看engine里面的ccaudioplayer.js 脚本 有更多相关的事件

对劲!就是他!非常感谢,然后哪个去哪查看的没看明白…

额 其实官方api audioplayer也是有的
http://www.cocos.com/docs/creator/api/classes/VideoPlayer.html

谢谢你!!!