From dff64f5a4781826aed77af428b55b9f0ba3d0f72 Mon Sep 17 00:00:00 2001 From: Rafael Date: Thu, 7 Apr 2022 12:20:47 -0300 Subject: [PATCH] Improve plugins format --- .../internal/plugins/videojs-mobile-ui/plugin.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ui/component/viewers/videoViewer/internal/plugins/videojs-mobile-ui/plugin.js b/ui/component/viewers/videoViewer/internal/plugins/videojs-mobile-ui/plugin.js index 8c1e02510..879b5a6e9 100644 --- a/ui/component/viewers/videoViewer/internal/plugins/videojs-mobile-ui/plugin.js +++ b/ui/component/viewers/videoViewer/internal/plugins/videojs-mobile-ui/plugin.js @@ -61,9 +61,7 @@ const onPlayerReady = (player, options) => { !player.el_.ownerDocument.querySelector('.bc-iframe') ) { player.tech_.el_.setAttribute('playsinline', 'playsinline'); - player.tech_.supportsFullScreen = function () { - return false; - }; + player.tech_.supportsFullScreen = () => false; } const controlBar = player.getChild('ControlBar'); @@ -150,14 +148,12 @@ const onPlayerReady = (player, options) => { * Whether to disable when the video ends (e.g., if there is an endscreen) * Never shows if the endscreen plugin is present */ -const mobileUi = function (options) { +function mobileUi(options) { // if (videojs.browser.IS_ANDROID || videojs.browser.IS_IOS) { if (videojs.browser.IS_ANDROID) { - this.ready(() => { - onPlayerReady(this, videojs.mergeOptions(defaults, options)); - }); + this.ready(() => onPlayerReady(this, videojs.mergeOptions(defaults, options))); } -}; +} // Register the plugin with video.js. registerPlugin('mobileUi', mobileUi);