Audon audioplayer App #1414

Merged
MrPetovan merged 19 commits from :develop into develop 2023-08-18 18:41:35 +02:00
4 changed files with 129 additions and 0 deletions
Showing only changes of commit 671aa134f7 - Show all commits

Audon Audio Chat based on the WebRTC Addon

This Addon based on webrtc. Audon is a service of realtime audio chat.
With small changes, the WebRTC addon could be adapted to Audon so that it can be loaded into an iframe. In the ifram, the Friendica handle can be connected and a room opened. Audio conversations between Friendica users are possible.
https://github.com/friendica/friendica-addons/pull/1357
loma-one 2023-06-20 17:26:03 +02:00

6
audon/README.md Normal file
View file

@ -0,0 +1,6 @@
Audon Addon
=============
This is a quick and dirty addon to add a [Audon][1] website as an app. This Addon based on webrtc. Audon is a service of realtime audio chat
[1]: https://codeberg.org/nmkj/audon

2
audon/admin.tpl Normal file
View file

@ -0,0 +1,2 @@
{{include file="field_input.tpl" field=$audonurl}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>

68
audon/audon.php Normal file
View file

@ -0,0 +1,68 @@
<<?php
/*
* Name: audon Application
loma-one marked this conversation as resolved Outdated

Please capitalize the Audon name when not used in code context.

Please capitalize the Audon name when not used in code context.
loma-one marked this conversation as resolved Outdated

Thanks for the change, however I meant "Audon", not "AUDON". I'll highlight the other instances I noticed.

Thanks for the change, however I meant "Audon", not "AUDON". I'll highlight the other instances I noticed.
* Description: add a audon instance for audio. Based on webRTC Addon
loma-one marked this conversation as resolved Outdated

Add an Audon instance

`Add an Audon instance`
* Version: 0.1
* Author: Stephen Mahood <https://friends.mayfirst.org/profile/marxistvegan>
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
* Author: Matthias Ebers <https://loma.ml/profile/feb>
*/
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
function audon_install()
{
Hook::register('app_menu', __FILE__, 'audon_app_menu');
}
function audon_app_menu(array &$b)
{
$b['app_menu'][] = '<div class="app-title"><a href="audon">' . DI::l10n()->t('audon Audiochat') . '</a></div>';
loma-one marked this conversation as resolved Outdated

Audon Audiochat

`Audon Audiochat`
}
function audon_addon_admin(string &$o)
{
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/audon/');
$o = Renderer::replaceMacros($t, [
'$submit' => DI::l10n()->t('Save Settings'),
'$audonurl' => [
'audonurl',
DI::l10n()->t('audon Base URL'),
loma-one marked this conversation as resolved Outdated
			DI::l10n()->t('Audon Base URL'),
```php DI::l10n()->t('Audon Base URL'), ```
DI::config()->get('audon','audonurl'),
loma-one marked this conversation as resolved Outdated

Code standards: Please add a space after commas.

Code standards: Please add a space after commas.
loma-one marked this conversation as resolved
			DI::config()->get('audon', 'audonurl'),
```php DI::config()->get('audon', 'audonurl'), ```
DI::l10n()->t('Page your users will create a audon Audio chat room on. For example you could use https://audon.space.'),
loma-one marked this conversation as resolved Outdated

Page your users will create an Audon audio chat room on. For example you could use https://audon.space.

`Page your users will create an Audon audio chat room on. For example you could use https://audon.space.`
],
]);
}
function audon_addon_admin_post()
{
DI::config()->set('audon', 'audonurl', trim($_POST['audonurl'] ?? ''));
}
/**
* This is a statement rather than an actual function definition. The simple
* existence of this method is checked to figure out if the addon offers a
* module.
*/
function audon_module() {}
function audon_content(): string
{
$o = '';
/* landingpage to create chatrooms */
$audonurl = DI::config()->get('audon','audonurl');
loma-one marked this conversation as resolved Outdated
	$audonurl = DI::config()->get('audon', 'audonurl');
```php $audonurl = DI::config()->get('audon', 'audonurl'); ```
/* embedd the landing page in an iframe */
$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>';
if ($audonurl == '') {
$o .= '<p>' . DI::l10n()->t('Please contact your friendica administrator to remind them to configure the Audon addon.') . '</p>';
loma-one marked this conversation as resolved

Please contact your Friendica administrator to remind them to configure the Audon addon.

`Please contact your Friendica administrator to remind them to configure the Audon addon.`
} else {
$o .= '<iframe src="' . $audonurl . '" width="740px" height="600px"></iframe>';
}
return $o;
}

53
audon/messages.po Normal file
View file

@ -0,0 +1,53 @@
# ADDON webrtc
# Copyright (C)
# This file is distributed under the same license as the Friendica webrtc addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-29 15:56+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: webrtc.php:18
msgid "WebRTC Videochat"
msgstr ""
#: webrtc.php:24
msgid "Save Settings"
msgstr ""
#: webrtc.php:25
msgid "WebRTC Base URL"
msgstr ""
#: webrtc.php:25
msgid ""
"Page your users will create a WebRTC chat room on. For example you could use "
"https://live.mayfirst.org ."
msgstr ""
#: webrtc.php:44
msgid "Video Chat"
msgstr ""
#: webrtc.php:45
msgid ""
"WebRTC is a video and audio conferencing tool that works in all modern "
"browsers. Just create a new chat room and send the link to someone you want "
"to chat with."
msgstr ""
#: webrtc.php:47
msgid ""
"Please contact your friendica admin and send a reminder to configure the "
"WebRTC addon."
msgstr ""