开发者社区> 问答> 正文

阿里云web播放器自定义组件添加

我想自定义几个组件实现拍照,录像,远程控制等功能,该怎么做呢?謝謝大家。文档的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('播放器创建好了。')
                        });

展开
收起
花间道 2019-03-04 21:05:06 4751 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
阿里云产品十月刊 立即下载
基于阿里云构建博学谷平台实时湖仓 立即下载
阿里云ElasticsearchSeverless版产品发布 立即下载