Files
ArtPlayer/packages/artplayer-document/docs/en/Questions/Create button in the controls.md
T
2021-11-28 16:36:42 +08:00

26 lines
574 B
Markdown

---
title: Add button to the controls
sidebar_position: 2
---
<div className="run-code">▶ Run Code</div>
```js
var time = 0;
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
controls: [
{
position: 'right',
html: '<button type="button">Click Me!</button>',
click: function (_, event) {
// The second parameter is an event object
time += 1;
event.target.innerText = 'You Click ' + time;
},
},
],
});
```