Audon is no longer launched as an iFrame, but as a browser window.

With the iFrame solution there could be problems activating the microphone settings. Therefore, a separate browser window is now opened.
pull/1446/head
loma-one 2023-12-10 16:40:49 +01:00
parent 5a3dc93c0d
commit 5e48ab5e84
1 changed files with 16 additions and 13 deletions

View File

@ -1,8 +1,8 @@
<?php <?php
/* /*
* Name: Audon Application * Name: Audon Application
* Description: add a Audon instance. Based on webRTC Addon * Description: add an Audon instance. Based on webRTC Addon
* Version: 0.1 * Version: 0.2
* Author: Stephen Mahood <https://friends.mayfirst.org/profile/marxistvegan> * Author: Stephen Mahood <https://friends.mayfirst.org/profile/marxistvegan>
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias> * Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
* Author: Matthias Ebers <https://loma.ml/profile/feb> * Author: Matthias Ebers <https://loma.ml/profile/feb>
@ -26,13 +26,13 @@ function audon_addon_admin(string &$o)
{ {
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/audon/'); $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/audon/');
$o = Renderer::replaceMacros($t, [ $o = Renderer::replaceMacros($t, [
'$submit' => DI::l10n()->t('Save Settings'), '$submit' => DI::l10n()->t('Save Settings'),
'$audonurl' => [ '$audonurl' => [
'audonurl', 'audonurl',
DI::l10n()->t('Audon Base URL'), DI::l10n()->t('Audon Base URL'),
DI::config()->get('audon','audonurl'), DI::config()->get('audon', 'audonurl'),
DI::l10n()->t('Page your users will create an Audon audio chat room on. For example you could use https://audon.space.'), DI::l10n()->t('Page your users will create an Audon audio chat room on. For example, you could use https://audon.space.'),
], ],
]); ]);
} }
@ -46,23 +46,26 @@ function audon_addon_admin_post()
* existence of this method is checked to figure out if the addon offers a * existence of this method is checked to figure out if the addon offers a
* module. * module.
*/ */
function audon_module() {} function audon_module()
{
}
function audon_content(): string function audon_content(): string
{ {
$o = ''; $o = '';
/* landingpage to create chatrooms */ /* landing page to create chatrooms */
$audonurl = DI::config()->get('audon', 'audonurl'); $audonurl = DI::config()->get('audon', 'audonurl');
/* open the landing page in a new browser window without controls */
$o .= '<script>
window.open("' . $audonurl . '", "_blank", "toolbar=no,scrollbars=no,resizable=no,top=100,left=100,width=740,height=600");
</script>';
/* embedd the landing page in an iframe */
$o .= '<h2>' . DI::l10n()->t('Audio Chat') . '</h2>'; $o .= '<h2>' . DI::l10n()->t('Audio Chat') . '</h2>';
$o .= '<p>' . DI::l10n()->t('Audon is an audio conferencing tool. Connect your account to Audon and create a room. Share the generated link to talk to other participants.') . '</p>'; $o .= '<p>' . DI::l10n()->t('Audon is an audio conferencing tool. Connect your account to Audon and create a room. Share the generated link to talk to other participants.') . '</p>';
if ($audonurl == '') { if ($audonurl == '') {
$o .= '<p>' . DI::l10n()->t('Please contact your Friendica administrator to remind them to configure the Audon addon.') . '</p>'; $o .= '<p>' . DI::l10n()->t('Please contact your Friendica administrator to remind them to configure the Audon addon.') . '</p>';
} else {
$o .= '<iframe src="' . $audonurl . '" width="740px" height="600px"></iframe>';
} }
return $o; return $o;