Opened 6 years ago

Closed 6 years ago

#7250 closed Feature/Enhancement Request (fixed)

lmo (webrtc) app for friends.mayfirst.org / friendica

Reported by: https://id.mayfirst.org/mahood Owned by: https://id.mayfirst.org/mahood
Priority: Medium Component: Tech
Keywords: webrtc app friendica php lmo Cc: Support-team@…
Sensitive: no

Description

In a brief conversation with a developer for the friendica software I asked if he was aware of any development to integrate webrtc and and video conferencing into their platform. Unfortunately there is no known development for the friendica software. But he did respond in saying that I should try to create one.

So I took at look at the github for the irc app that we have live on the site. It seems we need a little css code and php to call the lmo site in a frame or just css code. My php skills are limited but I would like to try to develop this but need some support on building the php file.

I can take ownership but would appreciate some php folks to give support and direction

~mv

Change History (4)

comment:1 Changed 6 years ago by https://id.mayfirst.org/ross

  • Owner set to https://id.mayfirst.org/mahood
  • Status changed from new to assigned

I'm sure you will get the assistance you need mv. Though I'm not 100% certain that webrtc is going to work inside an iframe.

comment:2 Changed 6 years ago by https://id.mayfirst.org/mahood

ross, thanks and now there is code to review :)

Along with the same colleague encouraging the creation of an app for friends.mayfirst.org and for the friendica community there is now one in the branch of the friendica addons git

It is technically working on friends.mayfirst.org/webrtc or through the apps link on the top bar. However there are some issues with the code as a tag that I am not sure about prevents the "create it" button from appearing in the body of the live.mayfirst.org iframe. There are other themes that do not break the code. However the way the php file is built it should ask when visiting the app which webrtc instance the user would like to use, however, our current git pull is a couple version behind. So for the moment the .htconfig.php file has been altered at the bottom with

// Temp to test webrtc before gitpull
$a->config['webrtc']['webrtcurl'] = 'https://live.mayfirst.org';

I have not successfully pulled the most recent git of friendica as the "git pull" command did not work resulting in this

0 friends@howard:~/friends.mayfirst.org/web$ git pull
fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.
1 friends@howard:~/friends.mayfirst.org/web$

Here is the php file that is being used

<?php
/*
* Name: WebRTC Application
* Description: add a webrtc instance for video/audio
* Version: 1.0
* Author: stephen mahood <https://friends.mayfirst.org/profile/marxistvegan>
* Author: Tobias Diekershoff <http://diekershoff.homeunix.net/friendica/profile/tobias>
*/

function webrtc_install() {
        register_hook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu');
}

function webrtc_uninstall() {
        unregister_hook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu');

}

function webrtc_app_menu($a,&$b) {
$b['app_menu'][] = '<div class="app-title"><a href="webrtc">' . t('WebRTC Videochat') . '</a></div>';
}

function webrtc_plugin_admin (&$a, &$o) {
        $t = get_markup_template( "admin.tpl", "addon/webrtc/" );
$o = replace_macros( $t, array(
'$submit' => t('Submit'),
'$webrtcurl' => array('webrtcurl', t('WebRTC Base URL'), get_config('webrtc','webrtcurl' ), t('Page your users will create a WebRTC chat room on. For example you could use https://live.mayfirst.org .')),
));
}
function webrtc_plugin_admin_post (&$a) {
        $url = ((x($_POST, 'webrtcurl')) ? notags(trim($_POST['webrtcurl'])) : '');
set_config('webrtc', 'webrtcurl', $url);
info( t('Settings updated.'). EOL);
}

function webrtc_module() {
return;
}

function webrtc_content(&$a) {
        $o = '';

        /* landingpage to create chatrooms */
        $webrtcurl = get_config('webrtc','webrtcurl');

        /* embedd the landing page in an iframe */
        $o .= '<h2>'.t('Video Chat').'</h2>';
        $o .= '<p>FIXME some short information for the enduser what to do. Best surrounded in a <code>t()</code> call so the text can be translated.</p>';
if ($webrtcurl == '') {
$o .= '<p>'.t('Please contact your friendica admin and send a reminder to configure the WebRTC addon.').'</p>';
} else {
$o .= '<iframe src="'.$webrtcurl.'" width="600px" height="600px"></iframe>';
}


        return $o;
}
?>

~mv

comment:3 Changed 6 years ago by https://id.mayfirst.org/ross

Awesome mv!!! I went ahead and made a couple of changes to diabook so that it allows for the creation of rooms.

The changes are on line 12, line 15, and line 59 of the file view/theme/diabook/bottom.tpl .

I suspect that this might complicate the git pull from the friendica repo, though I'm not sure.

The git command I think you want from the web directory is:

git pull github master

~/ross

comment:4 Changed 6 years ago by https://id.mayfirst.org/mahood

  • Resolution set to fixed
  • Status changed from assigned to closed

The webrtc app is functional and has a pull request for the friendica addon github

Though we still need to update our friendica instance this has been tested by updated servers by tobias

So we have an app w00t!

~mv

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.