Commit 889c8ed8 authored by Dele Olajide's avatar Dele Olajide

ofmeet plugin version 0.1.3

Implemented server-side Smack Virtual XMPP Connection for conference focus instead of default TCP connection
Updated chrome extension to 0.0.5
Updated Jitsi Videobridge to latest code
parent ed963634
......@@ -49,6 +49,14 @@
Openfire Meetings Plugin Changelog
</h1>
<p><b>0.1.3</b> -- Feb 28th, 2015</p>
<ul>
<li>Implemented server-side Smack Virtual XMPP Connection for conference focus instead of default TCP connection</li>
<li>Updated chrome extension to 0.0.5</li>
<li>Updated Jitsi Videobridge</li>
</ul>
<p><b>0.1.2</b> -- Feb 15th, 2015</p>
<ul>
......
......@@ -5,8 +5,8 @@
<name>Openfire Meetings</name>
<description>Provides high quality, scalable video conferences using Jitsi Meet and Jitsi Videobridge</description>
<author>Ignite Realtime</author>
<version>0.1.2</version>
<date>02/15/2015</date>
<version>0.1.3</version>
<date>02/20/2015</date>
<minServerVersion>3.9.9</minServerVersion>
<adminconsole>
......
<html>
<head>
<link rel="stylesheet" href="ofmeet.css?v=1"/>
<style>
html, body{
margin:0px;
......@@ -12,7 +11,6 @@
overflow-x: hidden;
}
</style>
<script src="/ofmeet/config"></script>
<script src="ofmeet.js?v=1"></script>
<script>
var conn = null;
......@@ -31,13 +29,14 @@
setInterval(function()
{
//ofmeet.toggleVideo();
//ofmeet.toggleAudio();
//ofmeet.toggleScreenSharing();
//ofmeet.toggleFilmStrip();
/*
ofmeet.toggleVideo();
ofmeet.toggleAudio();
ofmeet.toggleScreenSharing();
ofmeet.toggleFilmStrip();
ofmeet.visible(visible);
visible = !visible;
/*
if (joined)
{
ofmeet.leaveRoom();
......@@ -48,7 +47,9 @@
joined = true;
}
*/
}, 60000);
});
$(document).bind('ofmeet.ready', function ()
......@@ -60,7 +61,7 @@
$(document).ready(function ()
{
console.log("document.ready");
ofmeet.ready();
ofmeet.ready("deleolajide", "969131");
});
$(document).bind('remotevideo.resized', function (event, width, height)
......
......@@ -23880,8 +23880,8 @@ var ofmeet = (function(of)
var VideoLayout = (function (my) {
var currentDominantSpeaker = null;
var lastNCount = config.channelLastN;
var localLastNCount = config.channelLastN;
var lastNCount = -1;
var localLastNCount = -1;
var localLastNSet = [];
var lastNEndpointsCache = [];
var lastNPickupJid = null;
......@@ -23892,6 +23892,12 @@ var ofmeet = (function(of)
var defaultLocalDisplayName = "Me";
my.init = function()
{
lastNCount = config.channelLastN;
localLastNCount = config.chan
}
my.connectionIndicators = {};
my.isInLastN = function(resource) {
......@@ -27497,7 +27503,7 @@ var ofmeet = (function(of)
console.error(text);
};
var simulcast = new SimulcastManager();
var simulcast = null;
$(document).bind('simulcastlayerschanged', function (event, endpointSimulcastLayers) {
endpointSimulcastLayers.forEach(function (esl) {
......@@ -31984,14 +31990,38 @@ var ofmeet = (function(of)
$('#videospace').css("display", "none");
}
}
of.ready = function (username, password)
{
$.ajax({type: "GET", url: "/ofmeet/config", dataType: "script", headers: {"Authorization": "Basic " + btoa(username + ":" + password)}}).done(function()
{
var cssId = 'ofmeet-css';
if (!document.getElementById(cssId))
{
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = '/ofmeet/api/ofmeet.css';
link.media = 'all';
head.appendChild(link);
}
of.initialise();
})
}
of.ready = function ()
of.initialise = function ()
{
//console.log("of.ready");
console.log("of.initialise");
$('#videospace').css("display", "block");
VideoLayout.init();
Moderator.init();
simulcast = new SimulcastManager();
// Set default desktop sharing method
setDesktopSharing(config.desktopSharing);
......@@ -32157,7 +32187,7 @@ var ofmeet = (function(of)
}
of.VideoLayout = VideoLayout;
of.connection = connection;
of.connection = connection;
return of;
}(ofmeet || {}));
\ No newline at end of file
......@@ -17,13 +17,14 @@
setInterval(function()
{
console.log("ofmeet test cycle", joined);
/*
ofmeet.toggleVideo();
ofmeet.toggleAudio();
ofmeet.toggleScreenSharing();
ofmeet.toggleFilmStrip();
//ofmeet.toggleVideo();
//ofmeet.toggleAudio();
//ofmeet.toggleScreenSharing();
//ofmeet.toggleFilmStrip();
//ofmeet.visible(visible);
//visible = !visible;
ofmeet.visible(visible);
visible = !visible;
if (joined)
{
......@@ -35,10 +36,23 @@
joined = true;
}
*/
}, 60000);
});
$(document).bind('ofmeet.ready', function ()
{
console.log("ofmeet ready");
ofmeet.connect();
});
$(document).ready(function ()
{
console.log("document.ready");
ofmeet.ready("jamesbond", "007");
});
$(document).bind('remotevideo.resized', function (event, width, height)
{
//console.log("remotevideo.resized", event, width, height);
......
<html>
<template id="ofmeetTemplate">
<link rel="stylesheet" href="ofmeet.css?v=1"/>
</template>
<script src="/ofmeet/config"></script>
<script src="ofmeet.js?v=1"></script>
<script>
var importDoc = document.currentScript.ownerDocument;
var proto = Object.create(HTMLElement.prototype);
proto.createdCallback = function()
{
var shadow = document.body; // shadow dom does not currently work with jquery. Big TODO: remove jquery from ofmeet
var template = importDoc.querySelector('#ofmeetTemplate');
shadow.appendChild(template.content.cloneNode(true));
var room = this.getAttribute("room");
$(document).bind('ofmeet.connected', function (event, connection)
......@@ -22,18 +12,6 @@
//console.log("ofmeet connected", connection);
if (room) ofmeet.joinRoom(room, true);
});
$(document).bind('ofmeet.ready', function ()
{
//console.log("ofmeet ready");
ofmeet.connect();
});
$(document).ready(function ()
{
//console.log("document.ready");
ofmeet.ready();
});
};
document.registerElement("openfire-meetings", {prototype: proto});
......
......@@ -19,5 +19,5 @@
"name": "Openfire Meetings Chrome Extension",
"permissions": [ "desktopCapture" ],
"short_name": "ofmeet chrome extension",
"version": "0.0.3"
"version": "0.0.5"
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ var ofmeet = (function (my)
var CURSOR_WIDTH = Math.ceil(Math.sin(CURSOR_ANGLE) * CURSOR_HEIGHT);
var CLICK_TRANSITION_TIME = 3000;
var enableCursor = true;
var displayMouseClick = false;
var session = {
......@@ -691,7 +692,7 @@ var ofmeet = (function (my)
left: offset.left
});
displayClick({top: event.pageY, left: event.pageX}, 'red');
if (displayMouseClick) displayClick({top: event.pageY, left: event.pageX}, 'red');
});
}
......@@ -760,6 +761,8 @@ var ofmeet = (function (my)
my.handleAppMessage = function(json, from)
{
displayMouseClick = true;
//try {
var obj = JSON.parse(json);
//console.log("remote handleAppMessage", obj, json, from);
......
......@@ -74,7 +74,7 @@
<link rel="stylesheet" href="css/toastr.css?v=1">
<link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=30"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_default.css?v=16" id="videolayout_default"/>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="apps/font-awesome-4.0.3/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
<link rel="stylesheet" href="css/modaldialog.css?v=3">
<link rel="stylesheet" href="css/popup_menu.css?v=4">
......
/*
* Jitsi Videobridge, OpenSource video conferencing.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jitsi.videobridge.log;
/**
* Represents an event to be logged. An event has a name and a list of
* (key, value) pairs. The pairs are represented with the two arrays
* {@link #columns} and {@link #values} (the keys are though of as the names of
* the columns of a table).
*
* @author Boris Grozev
*/
public class Event
{
/**
* The name of this <tt>Event</tt>.
*/
private final String name;
/**
* The column names/keys of this <tt>Event</tt>.
*/
private final String[] columns;
/**
* The values corresponding to the elements of {@link #columns}.
*/
private final Object[] values;
/**
* Whether the local time should be used when this <tt>Event</tt> is being
* logged.
*/
private boolean useLocalTime = true;
/**
* Initializes a new <tt>Event</tt>. The number of elements in
* <tt>columns</tt> and <tt>values</tt> MUST match.
*
* @param name the name of the event.
* @param columns the column names/keys. The number of elements MUST be the
* same as the same number of elements in <tt>values</tt>.
* @param values the values. The number of elements MUST be the same as the
* same number of elements in <tt>columns</tt>.
*/
public Event(String name, String[] columns, Object[] values)
{
this.name = name;
this.columns = columns;
this.values = values;
}
/**
* Gets the name of this <tt>Event</tt>.
* @return the name of this <tt>Event</tt>.
*/
public String getName()
{
return name;
}
/**
* Gets the column names/keys of this <tt>Event</tt>.
* @return the column names/keys of this <tt>Event</tt>.
*/
public String[] getColumns()
{
return columns;
}
/**
* Gets the values corresponding to the column names/keys of this
* <tt>Event</tt>.
* @return the values corresponding to the column names/keys of this
* <tt>Event</tt>.
*/
public Object[] getValues()
{
return values;
}
/**
* Sets the <tt>useLocalTime</tt> flag of this <tt>Event</tt>.
* @param useLocalTime the value to set.
*/
public void setUseLocalTime(boolean useLocalTime)
{
this.useLocalTime = useLocalTime;
}
/**
* Gets the <tt>useLocalTime</tt> flag of this <tt>Event</tt>.
* @return the <tt>useLocalTime</tt> flag of this <tt>Event</tt>.
*/
public boolean useLocalTime()
{
return useLocalTime;
}
}
/*
* Jitsi Videobridge, OpenSource video conferencing.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jitsi.videobridge.log;
import org.jitsi.service.configuration.*;
import org.jitsi.videobridge.osgi.*;
import org.osgi.framework.*;
/**
* Implements a <tt>BundleActivator</tt> for <tt>LoggingService</tt>.
*
* @author Boris Grozev
*/
public class LoggingBundleActivator
implements BundleActivator
{
/**
* The <tt>LoggingService</tt> instance in use.
*/
private OpenfireEventService loggingService;
private ServiceRegistration<LoggingService> serviceRegistration;
/**
* Initializes a <tt>LoggingService</tt>.
* @param bundleContext the <tt>bundleContext</tt> to use.
* @throws Exception
*/
@Override
public void start(BundleContext bundleContext) throws Exception
{
loggingService = new OpenfireEventService();
serviceRegistration = bundleContext.registerService(LoggingService.class, loggingService, null);
}
/**
* Removes the previously initialized <tt>LoggingService</tt> instance
* from <tt>bundleContext</tt>.
* @param bundleContext the <tt>bundleContext</tt> to use.
* @throws Exception
*/
@Override
public void stop(BundleContext bundleContext) throws Exception
{
if (serviceRegistration != null)
{
serviceRegistration.unregister();
}
}
}
package org.jitsi.videobridge.log;
/**
* Allows logging of {@link org.jitsi.videobridge.log.Event}s.
*
* @author Boris Grozev
*/
public interface LoggingService
{
public void logEvent(Event event);
}
/*
* Jitsi Videobridge, OpenSource video conferencing.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jitsi.videobridge.log;
import org.jitsi.service.configuration.*;
import org.jitsi.util.*;
import org.json.simple.*;
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.concurrent.*;
import org.slf4j.*;
import org.slf4j.Logger;
/**
* Allows logging of {@link org.jitsi.videobridge.log.Event}s using an
* <tt>Openfire</tt> instance.
*
*/
public class OpenfireEventService implements LoggingService
{
private static final Logger Log = LoggerFactory.getLogger(OpenfireEventService.class);
/**
* The <tt>Executor</tt> which is to perform the task of sending data to
* <tt>Openfire</tt>.
*/
private final Executor executor = ExecutorUtils.newCachedThreadPool(true, OpenfireEventService.class.getName());
/**
* Initializes a new <tt>OpenfireEventService</tt> instance, by reading
* its configuration from <tt>cfg</tt>.
* @param cfg the <tt>ConfigurationService</tt> to use.
*
* @throws Exception if initialization fails
*/
OpenfireEventService() throws Exception
{
Log.info("Initialized OpenfireEventService");
}
/**
* Logs an <tt>Event</tt> to an <tt>InfluxDB</tt> database. This method
* returns without blocking, the blocking operations are performed in
* by a thread from {@link #executor}.
*
* @param e the <tt>Event</tt> to log.
*/
@SuppressWarnings("unchecked")
@Override
public void logEvent(Event e)
{
// The following is a sample JSON message in the format used by InfluxDB
// [
// {
// "name": "series_name",
// "columns": ["column1", "column2"],
// "points": [["value1", 1234]]
// }
// ]
JSONObject jsonObject = new JSONObject();
jsonObject.put("name", e.getName());
JSONArray columns = new JSONArray();
JSONArray point = new JSONArray();
if (e.useLocalTime())
{
columns.add("time");
point.add(System.currentTimeMillis());
}
Collections.addAll(columns, e.getColumns());
Collections.addAll(point, e.getValues());
jsonObject.put("columns", columns);
JSONArray points = new JSONArray();
points.add(point);
jsonObject.put("points", points);
JSONArray jsonArray = new JSONArray();
jsonArray.add(jsonObject);
// TODO: this is probably a good place to optimize by grouping multiple
// events in a single POST message and/or multiple points for events
// of the same type together).
final String jsonString = jsonArray.toJSONString();
executor.execute(new Runnable()
{
@Override
public void run()
{
sendPost(jsonString);
}
});
}
/**
* Sends the string <tt>s</tt> as the contents of an HTTP POST request to
* {@link #url}.
* @param s the content of the POST request.
*/
private void sendPost(final String s)
{
try
{
Log.info("OpenfireEventService sendPost " + s);
}
catch (Exception e)
{
Log.error("Failed to send event to Openfire: " + e);
}
}
}
......@@ -38,7 +38,7 @@ public class HttpProxy extends HttpServlet
String url = request.getParameter("url");
if (url != null) {
writeHeader(response);
writeHeader(url, response);
writeGet(url, response.getOutputStream());
}
......@@ -49,7 +49,7 @@ public class HttpProxy extends HttpServlet
}
private void writeHeader(HttpServletResponse response)
private void writeHeader(String urlString, HttpServletResponse response)
{
try {
......@@ -57,7 +57,12 @@ public class HttpProxy extends HttpServlet
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
response.setHeader("Content-Type", "application/pdf");
if (urlString.endsWith(".pdf"))
response.setHeader("Content-Type", "application/pdf");
else
response.setHeader("Content-Type", "text/html");
response.setHeader("Connection", "close");
}
catch(Exception e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment