From 4625dff19a98521fe019d71371dde6bcda21714a Mon Sep 17 00:00:00 2001 From: Fernando Serrano Carpena Date: Mon, 15 Jul 2019 12:37:20 +0200 Subject: [PATCH] now the configuration of the minimum window size of the plugins is in the configuration file. Fix #432 --- config/config.json | 33 +++++++++---------- doc/developers/plugin_creation.md | 1 - .../flexskipbutton.js | 1 - plugins/es.upv.paella.audioSelector/index.js | 1 - .../adapter.js | 1 - .../framecontrol.js | 1 - plugins/es.upv.paella.helpPlugin/help.js | 1 - .../qualities.js | 1 - .../playback_rate.js | 1 - plugins/es.upv.paella.ratePlugin/main.js | 1 - plugins/es.upv.paella.searchPlugin/search.js | 1 - plugins/es.upv.paella.socialPlugin/social.js | 1 - .../themechooser.js | 1 - plugins/es.upv.paella.track4kPlugin/main.js | 3 -- plugins/es.upv.paella.videoZoom/video_zoom.js | 3 -- .../es.upv.paella.viewModePlugin/viewmode.js | 1 - src/05_plugin_base.js | 2 +- 17 files changed, 17 insertions(+), 37 deletions(-) diff --git a/config/config.json b/config/config.json index a8670d64..bb2cc843 100644 --- a/config/config.json +++ b/config/config.json @@ -6,9 +6,8 @@ "videoQualityStrategyParams":{ "maxAutoQualityRes":720 }, "reloadOnFullscreen": true, "videoZoom": { - "enabled":true, - "max":800, - "minWindowSize":500 + "enabled":false, + "max":800 }, "deprecated-methods":[{"name":"streaming","enabled":true}, @@ -79,28 +78,28 @@ "//**** For a list of available plugins and configuration, go to": "https://github.com/polimediaupv/paella/blob/master/doc/plugins.md", "list":{ "//******* Button plugins": "", - "edu.harvard.dce.paella.flexSkipPlugin": {"enabled":true, "direction": "Rewind", "seconds": 10}, + "edu.harvard.dce.paella.flexSkipPlugin": {"enabled":true, "direction": "Rewind", "seconds": 10, "minWindowSize": 510 }, "edu.harvard.dce.paella.flexSkipForwardPlugin": {"enabled":true, "direction": "Forward", "seconds": 30}, "es.upv.paella.captionsPlugin": {"enabled":true, "searchOnCaptions":true}, - "es.upv.paella.extendedTabAdapterPlugin": {"enabled":true}, + "es.upv.paella.extendedTabAdapterPlugin": {"enabled":true, "minWindowSize": 400}, "es.upv.paella.footprintsPlugin": {"enabled":false}, - "es.upv.paella.frameControlPlugin": {"enabled": true, "showFullPreview": "auto", "showCaptions":true}, + "es.upv.paella.frameControlPlugin": {"enabled": true, "showFullPreview": "auto", "showCaptions":true, "minWindowSize": 450 }, "es.upv.paella.fullScreenButtonPlugin": {"enabled":true, "reloadOnFullscreen":{ "enabled":true, "keepUserSelection":true }}, - "es.upv.paella.helpPlugin": {"enabled":true, "langs":["en","es"]}, - "es.upv.paella.multipleQualitiesPlugin": {"enabled":true, "showWidthRes":true}, - "es.upv.paella.playbackRatePlugin": {"enabled":true, "availableRates": [0.75, 1, 1.25, 1.5]}, + "es.upv.paella.helpPlugin": {"enabled":true, "langs":["en","es"], "minWindowSize": 650 }, + "es.upv.paella.multipleQualitiesPlugin": {"enabled":true, "showWidthRes":true, "minWindowSize": 550 }, + "es.upv.paella.playbackRatePlugin": {"enabled":true, "availableRates": [0.75, 1, 1.25, 1.5], "minWindowSize": 500 }, "es.upv.paella.playPauseButtonPlugin": {"enabled":true}, - "es.upv.paella.searchPlugin": {"enabled":true, "sortType":"time", "colorSearch":false}, - "es.upv.paella.socialPlugin": {"enabled":true}, - "es.upv.paella.themeChooserPlugin": {"enabled":true}, - "es.upv.paella.viewModePlugin": { "enabled": true }, + "es.upv.paella.searchPlugin": {"enabled":true, "sortType":"time", "colorSearch":false, "minWindowSize": 550}, + "es.upv.paella.socialPlugin": {"enabled":true, "minWindowSize": 600}, + "es.upv.paella.themeChooserPlugin": {"enabled":true, "minWindowSize": 600}, + "es.upv.paella.viewModePlugin": { "enabled": true, "minWindowSize": 300 }, "es.upv.paella.volumeRangePlugin":{"enabled":true, "showMasterVolume": true, "showSlaveVolume": false }, "es.upv.paella.pipModePlugin": { "enabled":true }, - "es.upv.paella.ratePlugin": { "enabled":true }, + "es.upv.paella.ratePlugin": { "enabled":true, "minWindowSize": 500 }, "es.upv.paella.videoZoomPlugin": { "enabled":true }, - "es.upv.paella.audioSelector": { "enabled":true }, - "es.upv.paella.videoZoomToolbarPlugin": { "enabled":false, "targetStreamIndex":0 }, - "es.upv.paella.videoZoomTrack4kPlugin": { "enabled":true, "targetStreamIndex":0, "autoModeByDefault":false }, + "es.upv.paella.audioSelector": { "enabled":true, "minWindowSize": 400 }, + "es.upv.paella.videoZoomToolbarPlugin": { "enabled":false, "targetStreamIndex":0, "minWindowSize": 500 }, + "es.upv.paella.videoZoomTrack4kPlugin": { "enabled":true, "targetStreamIndex":0, "autoModeByDefault":false, "minWindowSize": 500 }, "es.upv.paella.airPlayPlugin": { "enabled":true }, "//***** Video Overlay Button Plugins": "", diff --git a/doc/developers/plugin_creation.md b/doc/developers/plugin_creation.md index 97d9978a..2be32926 100644 --- a/doc/developers/plugin_creation.md +++ b/doc/developers/plugin_creation.md @@ -68,7 +68,6 @@ example: helpPlugin.js (buttonPlugin) getSubclass() { return "helpButton"; } getIconClass() { return 'icon-help'; } getName() { return "es.upv.paella.helpPlugin"; } - getMinWindowSize() { return 650; } getDefaultToolTip() { return base.dictionary.translate("Show help") + ' (' + diff --git a/plugins/edu.harvard.dce.paella.flexSkipPlugin/flexskipbutton.js b/plugins/edu.harvard.dce.paella.flexSkipPlugin/flexskipbutton.js index b6a01a3c..9068d80f 100644 --- a/plugins/edu.harvard.dce.paella.flexSkipPlugin/flexskipbutton.js +++ b/plugins/edu.harvard.dce.paella.flexSkipPlugin/flexskipbutton.js @@ -7,7 +7,6 @@ paella.addPlugin(function() { getIconClass() { return 'icon-back-10-s'; } formatMessage() { return 'Rewind 10 seconds'; } getDefaultToolTip() { return base.dictionary.translate(this.formatMessage()); } - getMinWindowSize() { return 510; } checkEnabled(onSuccess) { onSuccess(!paella.player.isLiveStream()); diff --git a/plugins/es.upv.paella.audioSelector/index.js b/plugins/es.upv.paella.audioSelector/index.js index 3dea741b..2b8b95b3 100644 --- a/plugins/es.upv.paella.audioSelector/index.js +++ b/plugins/es.upv.paella.audioSelector/index.js @@ -4,7 +4,6 @@ paella.addPlugin(function() { getSubclass() { return "audioSelector"; } getIconClass() { return 'icon-headphone'; } getIndex() { return 2040; } - getMinWindowSize() { return 400; } getName() { return "es.upv.paella.audioSelector"; } getDefaultToolTip() { return base.dictionary.translate("Set audio stream"); } diff --git a/plugins/es.upv.paella.extendedTabAdapterPlugin/adapter.js b/plugins/es.upv.paella.extendedTabAdapterPlugin/adapter.js index 2b80939e..a8faae26 100644 --- a/plugins/es.upv.paella.extendedTabAdapterPlugin/adapter.js +++ b/plugins/es.upv.paella.extendedTabAdapterPlugin/adapter.js @@ -18,7 +18,6 @@ paella.addPlugin(function() { getSubclass() { return "extendedTabAdapterPlugin"; } getIconClass() { return 'icon-folder'; } getIndex() { return 2030; } - getMinWindowSize() { return 550; } getName() { return "es.upv.paella.extendedTabAdapterPlugin"; } getDefaultToolTip() { return base.dictionary.translate("Extended Tab Adapter"); } getButtonType() { return paella.ButtonPlugin.type.popUpButton; } diff --git a/plugins/es.upv.paella.frameControlPlugin/framecontrol.js b/plugins/es.upv.paella.frameControlPlugin/framecontrol.js index 9670934e..5b185d2a 100644 --- a/plugins/es.upv.paella.frameControlPlugin/framecontrol.js +++ b/plugins/es.upv.paella.frameControlPlugin/framecontrol.js @@ -48,7 +48,6 @@ paella.addPlugin(function() { getSubclass() { return "frameControl"; } getIconClass() { return 'icon-photo'; } getIndex() { return 510; } - getMinWindowSize() { return 450; } getName() { return "es.upv.paella.frameControlPlugin"; } getButtonType() { return paella.ButtonPlugin.type.timeLineButton; } getDefaultToolTip() { return base.dictionary.translate("Navigate by slides"); } diff --git a/plugins/es.upv.paella.helpPlugin/help.js b/plugins/es.upv.paella.helpPlugin/help.js index 9babd27e..5741a2b3 100644 --- a/plugins/es.upv.paella.helpPlugin/help.js +++ b/plugins/es.upv.paella.helpPlugin/help.js @@ -6,7 +6,6 @@ paella.addPlugin(function() { getSubclass() { return "helpButton"; } getIconClass() { return 'icon-help'; } getName() { return "es.upv.paella.helpPlugin"; } - getMinWindowSize() { return 650; } getDefaultToolTip() { return base.dictionary.translate("Show help") + ' (' + base.dictionary.translate("Paella version:") + ' ' + paella.version + ')'; } diff --git a/plugins/es.upv.paella.multipleQualitiesPlugin/qualities.js b/plugins/es.upv.paella.multipleQualitiesPlugin/qualities.js index b5955812..6fdb6bd2 100644 --- a/plugins/es.upv.paella.multipleQualitiesPlugin/qualities.js +++ b/plugins/es.upv.paella.multipleQualitiesPlugin/qualities.js @@ -6,7 +6,6 @@ paella.addPlugin(function() { getSubclass() { return "showMultipleQualitiesPlugin"; } getIconClass() { return 'icon-screen'; } getIndex() { return 2030; } - getMinWindowSize() { return 550; } getName() { return "es.upv.paella.multipleQualitiesPlugin"; } getDefaultToolTip() { return base.dictionary.translate("Change video quality"); } diff --git a/plugins/es.upv.paella.playbackRatePlugin/playback_rate.js b/plugins/es.upv.paella.playbackRatePlugin/playback_rate.js index 778aee5d..7cb8dfe0 100644 --- a/plugins/es.upv.paella.playbackRatePlugin/playback_rate.js +++ b/plugins/es.upv.paella.playbackRatePlugin/playback_rate.js @@ -6,7 +6,6 @@ paella.addPlugin(function() { getSubclass() { return "showPlaybackRateButton"; } getIconClass() { return 'icon-screen'; } getIndex() { return 140; } - getMinWindowSize() { return 500; } getName() { return "es.upv.paella.playbackRatePlugin"; } getButtonType() { return paella.ButtonPlugin.type.popUpButton; } getDefaultToolTip() { return base.dictionary.translate("Set playback rate"); } diff --git a/plugins/es.upv.paella.ratePlugin/main.js b/plugins/es.upv.paella.ratePlugin/main.js index f6408213..9e0b596b 100644 --- a/plugins/es.upv.paella.ratePlugin/main.js +++ b/plugins/es.upv.paella.ratePlugin/main.js @@ -6,7 +6,6 @@ paella.addPlugin(function() { getSubclass() { return "rateButtonPlugin"; } getIconClass() { return 'icon-star'; } getIndex() { return 540; } - getMinWindowSize() { return 500; } getName() { return "es.upv.paella.ratePlugin"; } getButtonType() { return paella.ButtonPlugin.type.popUpButton; } getDefaultToolTip() { return base.dictionary.translate("Rate this video"); } diff --git a/plugins/es.upv.paella.searchPlugin/search.js b/plugins/es.upv.paella.searchPlugin/search.js index f1cfc0c1..9bc65bc6 100644 --- a/plugins/es.upv.paella.searchPlugin/search.js +++ b/plugins/es.upv.paella.searchPlugin/search.js @@ -3,7 +3,6 @@ paella.addPlugin(function() { getAlignment() { return 'right'; } getSubclass() { return 'searchButton'; } getIconClass() { return 'icon-binoculars'; } - getMinWindowSize() { return 550; } getName() { return "es.upv.paella.searchPlugin"; } getButtonType() { return paella.ButtonPlugin.type.popUpButton; } getDefaultToolTip() { return base.dictionary.translate("Search"); } diff --git a/plugins/es.upv.paella.socialPlugin/social.js b/plugins/es.upv.paella.socialPlugin/social.js index 858736fe..283774d4 100644 --- a/plugins/es.upv.paella.socialPlugin/social.js +++ b/plugins/es.upv.paella.socialPlugin/social.js @@ -4,7 +4,6 @@ paella.addPlugin(function() { getSubclass() { return "showSocialPluginButton"; } getIconClass() { return 'icon-social'; } getIndex() { return 560; } - getMinWindowSize() { return 600; } getName() { return "es.upv.paella.socialPlugin"; } checkEnabled(onSuccess) { onSuccess(true); } getDefaultToolTip() { return base.dictionary.translate("Share this video"); } diff --git a/plugins/es.upv.paella.themeChooser/themechooser.js b/plugins/es.upv.paella.themeChooser/themechooser.js index 4b2d1fb6..0905ac62 100644 --- a/plugins/es.upv.paella.themeChooser/themechooser.js +++ b/plugins/es.upv.paella.themeChooser/themechooser.js @@ -4,7 +4,6 @@ paella.addPlugin(function() { getSubclass() { return "themeChooserPlugin"; } getIconClass() { return 'icon-paintbrush'; } getIndex() { return 2030; } - getMinWindowSize() { return 600; } getName() { return "es.upv.paella.themeChooserPlugin"; } getDefaultToolTip() { return base.dictionary.translate("Change theme"); } getButtonType() { return paella.ButtonPlugin.type.popUpButton; } diff --git a/plugins/es.upv.paella.track4kPlugin/main.js b/plugins/es.upv.paella.track4kPlugin/main.js index 3619fe56..461e4935 100644 --- a/plugins/es.upv.paella.track4kPlugin/main.js +++ b/plugins/es.upv.paella.track4kPlugin/main.js @@ -194,9 +194,6 @@ paella.addDataDelegate("cameraTrack",() => { getIconClass() { return 'icon-screen'; } closeOnMouseOut() { return true; } getIndex() { return 2030; } - getMinWindowSize() { return (paella.player.config.player && - paella.player.config.player.videoZoom && - paella.player.config.player.videoZoom.minWindowSize) || 600; } getName() { return "es.upv.paella.videoZoomTrack4kPlugin"; } getDefaultToolTip() { return base.dictionary.translate("Set video zoom"); } getButtonType() { return paella.ButtonPlugin.type.popUpButton; } diff --git a/plugins/es.upv.paella.videoZoom/video_zoom.js b/plugins/es.upv.paella.videoZoom/video_zoom.js index 8337bbb6..178c4bdc 100644 --- a/plugins/es.upv.paella.videoZoom/video_zoom.js +++ b/plugins/es.upv.paella.videoZoom/video_zoom.js @@ -192,9 +192,6 @@ paella.addPlugin(function() { getSubclass() { return "videoZoomToolbar"; } getIconClass() { return 'icon-screen'; } getIndex() { return 2030; } - getMinWindowSize() { return (paella.player.config.player && - paella.player.config.player.videoZoom && - paella.player.config.player.videoZoom.minWindowSize) || 600; } getName() { return "es.upv.paella.videoZoomToolbarPlugin"; } getDefaultToolTip() { return base.dictionary.translate("Set video zoom"); } getButtonType() { return paella.ButtonPlugin.type.popUpButton; } diff --git a/plugins/es.upv.paella.viewModePlugin/viewmode.js b/plugins/es.upv.paella.viewModePlugin/viewmode.js index 61a26a89..a58afcbe 100644 --- a/plugins/es.upv.paella.viewModePlugin/viewmode.js +++ b/plugins/es.upv.paella.viewModePlugin/viewmode.js @@ -6,7 +6,6 @@ paella.addPlugin(function() { getSubclass() { return "showViewModeButton"; } getIconClass() { return 'icon-presentation-mode'; } getIndex() { return 540; } - getMinWindowSize() { return 300; } getName() { return "es.upv.paella.viewModePlugin"; } getButtonType() { return paella.ButtonPlugin.type.popUpButton; } getDefaultToolTip() { return base.dictionary.translate("Change video layout"); } diff --git a/src/05_plugin_base.js b/src/05_plugin_base.js index 844a28cb..25a1308a 100644 --- a/src/05_plugin_base.js +++ b/src/05_plugin_base.js @@ -485,7 +485,7 @@ class ButtonPlugin extends paella.UIPlugin { } getMinWindowSize() { - return 0; + return this.config.minWindowSize || 0; } buildContent(domElement) {