简体   繁体   English

在Azure Media Player上插入按钮

[英]Inserting buttons on Azure Media Player

What I want to do is to insert my own custom buttons inside the Azure Media Player. 我想要做的是在Azure Media Player中插入我自己的自定义按钮。 Since I don't have access on the tags. 由于我无法访问标签。 I want to append my buttons instead inside the div element of the Azure Media Player. 我想将我的按钮添加到Azure Media Player的div元素中。 Is there any way that i can insert a div element inside a div of an innaccessible html? 有没有办法,我可以在一个无法访问的HTML的div中插入一个div元素?

Here's the elements that i want to insert: 这是我要插入的元素:

<button  id="play"      onclick="playPause(this.id);">❚❚</button>
<button  id="myTime"     onclick="stopTime()">∎</button>
<button  id="mute"       onclick ="muteVid()">Mute</button>
<button  id="rewindTime" onclick="rewindTime()">◄◄</button>

And here is the snap shot of the div class that i want it to be inserted to. 这里是我想要插入的div类的快照。

在此输入图像描述

I just want to insert the buttons inside that vjs-control-bar div class. 我只想在vjs-control-bar div类中插入按钮。 Is there a way to do it? 有办法吗?

We can add it via plugins 我们可以通过插件添加它

(function (mediaPlayer) {
    mediaPlayer.plugin('pluginname', function (options) {
        var buttonContainer = this.controlBar.el();

        var buttonEl = mediaPlayer.createEl('button', { <button property>});
        buttonContainer .appendChild(buttonEl);        
    });
}(window.amp));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM