From e170e053e1aff87fa2b1e81811bc0947a2217616 Mon Sep 17 00:00:00 2001 From: DanieL Date: Fri, 30 Dec 2022 10:06:43 -0300 Subject: [PATCH] Updates --- .gitignore | 1 + plugin/AVideoPlugin.php | 17 +++++++++++++++++ plugin/MobileManager/getConfiguration.json.php | 2 ++ plugin/Plugin.abstract.php | 4 ++++ view/js/script.js | 3 ++- view/user.php | 9 ++++++++- 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ecb7b023fa..e91c62c4ac 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,4 @@ objects/ezyang/ view/videoComments_bkp.php /.compose/ test.php +/plugin/JosephZ/ diff --git a/plugin/AVideoPlugin.php b/plugin/AVideoPlugin.php index 654094f414..7e8e9028b6 100644 --- a/plugin/AVideoPlugin.php +++ b/plugin/AVideoPlugin.php @@ -2410,6 +2410,23 @@ class AVideoPlugin } return; } + + public static function getMobileHomePageURL() + { + $plugins = Plugin::getAllEnabled(); + foreach ($plugins as $value) { + self::YPTstart(); + $p = static::loadPlugin($value['dirName']); + if (is_object($p)) { + $url = $p->getMobileHomePageURL(); + if(isValidURL($url)){ + return $url; + } + } + self::YPTend("{$value['dirName']}::" . __FUNCTION__); + } + return false; + } public static function getPluginsOnByDefault($getUUID = true) { diff --git a/plugin/MobileManager/getConfiguration.json.php b/plugin/MobileManager/getConfiguration.json.php index 35ae4c83f0..f91f46421c 100644 --- a/plugin/MobileManager/getConfiguration.json.php +++ b/plugin/MobileManager/getConfiguration.json.php @@ -18,6 +18,8 @@ if(!empty($chat2)){ $objMM->chat2ShowOnUserVideos = false; } +$objMM->homePageURL = AVideoPlugin::getMobileHomePageURL(); + $objMM->logo = getURL($config->getLogo()); $objMM->favicon = $config->getFavicon(true); $objMM->title = $config->getWebSiteTitle(); diff --git a/plugin/Plugin.abstract.php b/plugin/Plugin.abstract.php index a811b2ad0e..a63bd14682 100644 --- a/plugin/Plugin.abstract.php +++ b/plugin/Plugin.abstract.php @@ -793,6 +793,10 @@ abstract class PluginAbstract { function onVideoSetSerie_playlists_id($video_id, $oldValue, $newValue) { } + + function getMobileHomePageURL() { + return false; + } function updateParameter($parameterName, $newValue) { $pluginDO = $this->getDataObject(); diff --git a/view/js/script.js b/view/js/script.js index 02f44a2613..ddd692cb4c 100644 --- a/view/js/script.js +++ b/view/js/script.js @@ -3710,7 +3710,8 @@ async function sendAVideoMobileLiveStreamerMessage(type, value){ }, 1000); } } else { - console.log('sendAVideoMobileLiveStreamerMessage error', type, value); + //window.parent.postMessage({type: type, value: value}, '*'); + window.top.postMessage({type: type, value: value}, '*'); } } window.addEventListener("flutterInAppWebViewPlatformReady", function (event) { diff --git a/view/user.php b/view/user.php index 95de9e1d78..314cf4ba59 100644 --- a/view/user.php +++ b/view/user.php @@ -30,7 +30,14 @@ if (User::isLogged()) {
- +