Files
_hublib-web/dist/react/video-player/components/video-js/plugins/big-play-pause-button/index.js
2026-02-27 09:50:13 +03:00

26 lines
852 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import videojs from "video.js";
const BigPlayButton = videojs.getComponent("BigPlayButton");
class BigPlayPauseButton extends BigPlayButton {
handleClick(e) {
const player = this.player();
if (player.paused()) {
player.play();
}
else {
player.pause();
}
}
}
videojs.registerComponent("BigPlayPauseButton", BigPlayPauseButton);
// Функция плагина с аннотацией типа this
function bigPlayPauseButtonPlugin() {
const player = this;
const defaultButton = player.getChild("bigPlayButton");
if (defaultButton) {
defaultButton.dispose();
}
player.addChild("BigPlayPauseButton", {});
}
videojs.registerPlugin("bigPlayPauseButton", bigPlayPauseButtonPlugin);
export default bigPlayPauseButtonPlugin;
//# sourceMappingURL=index.js.map