我想自定义几个组件实现拍照,录像,远程控制等功能,该怎么做呢?謝謝大家。文档的createEl和init方面不是很懂。
<div class="player-olympic-player-next-tip">test</div>
</div>
var test = Aliplayer.Component({
init: function(clickHandle) {
this.clickHandle = clickHandle;
this.$html = $(".player-olympic-player-next").html();
},
createEl: function(el) {
this.$html = $(".player-olympic-player-next").html();
$(el).append(this.$html);
},
ready: function(player, e) {
},
play: function(player, e) {
this.$html.hide();
},
pause: function(player, e) {
this.$html.show();
}
});
playVideos = new Aliplayer({
id: “test”,
// isLive: true,
/*useH5Prism:true,
useFlashPrism: false,*/
isLive: false,
playsinline: true,
width: "100%",
height: "100%",
useH5Prism: true, //启用H5播放器
useFlashPrism: false,
cover: "",
components: [{
name: 'adComponent',
type: test
}],
//支持播放地址播放,此播放优先级最高
source: videoAdd[i]
}, function(player) {
console.log('播放器创建好了。')
});