我想自定义几个组件实现拍照,录像,远程控制等功能,该怎么做呢?謝謝大家。文档的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('播放器创建好了。')
});
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。