Removes prezi.
This commit is contained in:
parent
ed85658ce5
commit
4ff6d276ce
|
@ -4,7 +4,7 @@ Jitsi Meet is an open-source (Apache) WebRTC JavaScript application that uses [J
|
|||
|
||||
You can also try it out yourself at https://meet.jit.si .
|
||||
|
||||
Jitsi Meet allows for very efficient collaboration. It allows users to stream their desktop or only some windows. It also supports shared document editing with Etherpad and remote presentations with Prezi.
|
||||
Jitsi Meet allows for very efficient collaboration. It allows users to stream their desktop or only some windows. It also supports shared document editing with Etherpad.
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
@ -27,9 +27,7 @@ let room, connection, localAudio, localVideo, roomLocker;
|
|||
const Commands = {
|
||||
CONNECTION_QUALITY: "stats",
|
||||
EMAIL: "email",
|
||||
ETHERPAD: "etherpad",
|
||||
PREZI: "prezi",
|
||||
STOP_PREZI: "stop-prezi"
|
||||
ETHERPAD: "etherpad"
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -687,7 +685,6 @@ export default {
|
|||
console.log('USER %s LEFT', id, user);
|
||||
APP.API.notifyUserLeft(id);
|
||||
APP.UI.removeUser(id, user.getDisplayName());
|
||||
APP.UI.stopPrezi(id);
|
||||
});
|
||||
|
||||
|
||||
|
@ -866,35 +863,6 @@ export default {
|
|||
APP.UI.initEtherpad(value);
|
||||
});
|
||||
|
||||
room.addCommandListener(Commands.PREZI, ({value, attributes}) => {
|
||||
APP.UI.showPrezi(attributes.id, value, attributes.slide);
|
||||
});
|
||||
|
||||
room.addCommandListener(Commands.STOP_PREZI, ({attributes}) => {
|
||||
APP.UI.stopPrezi(attributes.id);
|
||||
});
|
||||
|
||||
APP.UI.addListener(UIEvents.SHARE_PREZI, (url, slide) => {
|
||||
console.log('Sharing Prezi %s slide %s', url, slide);
|
||||
room.removeCommand(Commands.PREZI);
|
||||
room.sendCommand(Commands.PREZI, {
|
||||
value: url,
|
||||
attributes: {
|
||||
id: room.myUserId(),
|
||||
slide
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
APP.UI.addListener(UIEvents.STOP_SHARING_PREZI, () => {
|
||||
room.removeCommand(Commands.PREZI);
|
||||
room.sendCommandOnce(Commands.STOP_PREZI, {
|
||||
attributes: {
|
||||
id: room.myUserId()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
APP.UI.addListener(UIEvents.EMAIL_CHANGED, (email = '') => {
|
||||
email = email.trim();
|
||||
|
||||
|
|
|
@ -63,9 +63,6 @@
|
|||
.icon-exit-full-screen:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
.icon-prezi:before {
|
||||
content: "\e60c";
|
||||
}
|
||||
.icon-link:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
|
|
@ -122,7 +122,6 @@
|
|||
<a class="button icon-chat" id="toolbar_button_chat" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="bottom" data-i18n="[content]toolbar.chat" content="Open / close chat">
|
||||
<span id="unreadMessages"></span>
|
||||
</a>
|
||||
<a class="button icon-prezi" id="toolbar_button_prezi" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.prezi" content="Share Prezi"></a>
|
||||
<a class="button icon-share-doc" id="toolbar_button_etherpad" data-container="body" data-toggle="popover" data-placement="bottom" content="Shared document" data-i18n="[content]toolbar.etherpad"></a>
|
||||
<a class="button icon-share-desktop" id="toolbar_button_desktopsharing" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="toggleDesktopSharingPopover" content="Share screen" data-i18n="[content]toolbar.sharescreen" style="display: none"></a>
|
||||
<a class="button icon-full-screen" id="toolbar_button_fullScreen" data-container="body" data-toggle="popover" data-placement="bottom" content="Enter / Exit Full Screen" data-i18n="[content]toolbar.fullscreen"></a>
|
||||
|
@ -134,7 +133,6 @@
|
|||
</div>
|
||||
<div id="subject"></div>
|
||||
</div>
|
||||
<div id="reloadPresentation"><a id="reloadPresentationLink"><i title="Reload Prezi" class="fa fa-repeat fa-lg"></i></a></div>
|
||||
<div id="videospace">
|
||||
|
||||
<div id="largeVideoContainer" class="videocontainer">
|
||||
|
|
|
@ -16,7 +16,7 @@ var interfaceConfig = {
|
|||
INVITATION_POWERED_BY: true,
|
||||
DOMINANT_SPEAKER_AVATAR_SIZE: 100,
|
||||
TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop',
|
||||
'recording', 'security', 'invite', 'chat', 'prezi', 'etherpad',
|
||||
'recording', 'security', 'invite', 'chat', 'etherpad',
|
||||
'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip',
|
||||
'contacts'],
|
||||
// Determines how the video would fit the screen. 'both' would fit the whole
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
"me": "me",
|
||||
"speaker": "Speaker",
|
||||
"defaultNickname": "ex. __name__",
|
||||
"defaultPreziLink": "e.g. __url__",
|
||||
"welcomepage":{
|
||||
"go": "GO",
|
||||
"roomname": "Enter room name",
|
||||
|
@ -55,7 +54,6 @@
|
|||
"lock": "Lock / unlock room",
|
||||
"invite": "Invite others",
|
||||
"chat": "Open / close chat",
|
||||
"prezi": "Share Prezi",
|
||||
"etherpad": "Shared document",
|
||||
"sharescreen": "Share screen",
|
||||
"fullscreen": "Enter / Exit Full Screen",
|
||||
|
@ -159,10 +157,6 @@
|
|||
"defaultError": "There was some kind of error",
|
||||
"passwordRequired": "Password required",
|
||||
"Ok": "Ok",
|
||||
"removePreziTitle": "Remove Prezi",
|
||||
"removePreziMsg": "Are you sure you would like to remove your Prezi?",
|
||||
"sharePreziTitle": "Share a Prezi",
|
||||
"sharePreziMsg": "Another participant is already sharing a Prezi. This conference allows only one Prezi at a time.",
|
||||
"Remove": "Remove",
|
||||
"WaitingForHost": "Waiting for the host ...",
|
||||
"WaitForHostMsg": "The conference <b>__room__ </b> has not yet started. If you are the host then please authenticate. Otherwise, please wait for the host to arrive.",
|
||||
|
@ -175,7 +169,6 @@
|
|||
"hungUp": "You hung up",
|
||||
"joinAgain": "Join again",
|
||||
"Share": "Share",
|
||||
"preziLinkError": "Please provide a correct prezi link.",
|
||||
"Save": "Save",
|
||||
"recordingToken": "Enter recording token",
|
||||
"Dial": "Dial",
|
||||
|
|
|
@ -12,7 +12,6 @@ import PanelToggler from "./side_pannels/SidePanelToggler";
|
|||
import UIUtil from "./util/UIUtil";
|
||||
import UIEvents from "../../service/UI/UIEvents";
|
||||
import CQEvents from '../../service/connectionquality/CQEvents';
|
||||
import PreziManager from './prezi/Prezi';
|
||||
import EtherpadManager from './etherpad/Etherpad';
|
||||
|
||||
import VideoLayout from "./videolayout/VideoLayout";
|
||||
|
@ -30,7 +29,6 @@ var Feedback = require("./Feedback");
|
|||
var eventEmitter = new EventEmitter();
|
||||
UI.eventEmitter = eventEmitter;
|
||||
|
||||
let preziManager;
|
||||
let etherpadManager;
|
||||
|
||||
/**
|
||||
|
@ -96,7 +94,6 @@ function setupChat() {
|
|||
*/
|
||||
function setupToolbars() {
|
||||
Toolbar.init(eventEmitter);
|
||||
Toolbar.setupButtonsFromConfig();
|
||||
BottomToolbar.setupListeners(eventEmitter);
|
||||
}
|
||||
|
||||
|
@ -256,9 +253,6 @@ UI.mucJoined = function () {
|
|||
* Setup some UI event listeners.
|
||||
*/
|
||||
function registerListeners() {
|
||||
UI.addListener(UIEvents.PREZI_CLICKED, function () {
|
||||
preziManager.handlePreziButtonClicked();
|
||||
});
|
||||
|
||||
UI.addListener(UIEvents.ETHERPAD_CLICKED, function () {
|
||||
if (etherpadManager) {
|
||||
|
@ -337,7 +331,6 @@ UI.start = function () {
|
|||
ContactList.init(eventEmitter);
|
||||
|
||||
bindEvents();
|
||||
preziManager = new PreziManager(eventEmitter);
|
||||
if (!interfaceConfig.filmStripOnly) {
|
||||
|
||||
$("#videospace").mousemove(function () {
|
||||
|
@ -998,26 +991,6 @@ UI.updateAuthInfo = function (isAuthEnabled, login) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Show Prezi from the user.
|
||||
* @param {string} userId user id
|
||||
* @param {string} url Prezi url
|
||||
* @param {number} slide slide to show
|
||||
*/
|
||||
UI.showPrezi = function (userId, url, slide) {
|
||||
preziManager.showPrezi(userId, url, slide);
|
||||
};
|
||||
|
||||
/**
|
||||
* Stop showing Prezi from the user.
|
||||
* @param {string} userId user id
|
||||
*/
|
||||
UI.stopPrezi = function (userId) {
|
||||
if (preziManager.isSharing(userId)) {
|
||||
preziManager.removePrezi(userId);
|
||||
}
|
||||
};
|
||||
|
||||
UI.onStartMutedChanged = function (startAudioMuted, startVideoMuted) {
|
||||
SettingsMenu.updateStartMutedBox(startAudioMuted, startVideoMuted);
|
||||
};
|
||||
|
|
|
@ -1,448 +0,0 @@
|
|||
/* global $, APP */
|
||||
/* jshint -W101 */
|
||||
|
||||
import VideoLayout from "../videolayout/VideoLayout";
|
||||
import LargeContainer from '../videolayout/LargeContainer';
|
||||
import PreziPlayer from './PreziPlayer';
|
||||
import UIUtil from '../util/UIUtil';
|
||||
import UIEvents from '../../../service/UI/UIEvents';
|
||||
import messageHandler from '../util/MessageHandler';
|
||||
import ToolbarToggler from "../toolbars/ToolbarToggler";
|
||||
import SidePanelToggler from "../side_pannels/SidePanelToggler";
|
||||
import FilmStrip from '../videolayout/FilmStrip';
|
||||
|
||||
/**
|
||||
* Example of Prezi link.
|
||||
*/
|
||||
const defaultPreziLink = "http://prezi.com/wz7vhjycl7e6/my-prezi";
|
||||
const alphanumRegex = /^[a-z0-9-_\/&\?=;]+$/i;
|
||||
/**
|
||||
* Default aspect ratio for Prezi frame.
|
||||
*/
|
||||
const aspectRatio = 16.0 / 9.0;
|
||||
|
||||
/**
|
||||
* Default Prezi frame width.
|
||||
*/
|
||||
const DEFAULT_WIDTH = 640;
|
||||
/**
|
||||
* Default Prezi frame height.
|
||||
*/
|
||||
const DEFAULT_HEIGHT = 480;
|
||||
|
||||
/**
|
||||
* Indicates if the given string is an alphanumeric string.
|
||||
* Note that some special characters are also allowed (-, _ , /, &, ?, =, ;) for the
|
||||
* purpose of checking URIs.
|
||||
* @param {string} unsafeText string to check
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isAlphanumeric(unsafeText) {
|
||||
return alphanumRegex.test(unsafeText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the presentation id from the given url.
|
||||
* @param {string} url Prezi link
|
||||
* @returns {string} presentation id
|
||||
*/
|
||||
function getPresentationId (url) {
|
||||
let presId = url.substring(url.indexOf("prezi.com/") + 10);
|
||||
return presId.substring(0, presId.indexOf('/'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given string is Prezi url.
|
||||
* @param {string} url string to check.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isPreziLink(url) {
|
||||
if (url.indexOf('http://prezi.com/') !== 0 && url.indexOf('https://prezi.com/') !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let presId = url.substring(url.indexOf("prezi.com/") + 10);
|
||||
if (!isAlphanumeric(presId) || presId.indexOf('/') < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify user that other user if already sharing Prezi.
|
||||
*/
|
||||
function notifyOtherIsSharingPrezi() {
|
||||
messageHandler.openMessageDialog(
|
||||
"dialog.sharePreziTitle",
|
||||
"dialog.sharePreziMsg"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask user if he want to close Prezi he's sharing.
|
||||
*/
|
||||
function proposeToClosePrezi() {
|
||||
return new Promise(function (resolve, reject) {
|
||||
messageHandler.openTwoButtonDialog(
|
||||
"dialog.removePreziTitle",
|
||||
null,
|
||||
"dialog.removePreziMsg",
|
||||
null,
|
||||
false,
|
||||
"dialog.Remove",
|
||||
function(e,v,m,f) {
|
||||
if (v) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask user for Prezi url to share with others.
|
||||
* Dialog validates client input to allow only Prezi urls.
|
||||
*/
|
||||
function requestPreziLink() {
|
||||
const title = APP.translation.generateTranslationHTML("dialog.sharePreziTitle");
|
||||
const cancelButton = APP.translation.generateTranslationHTML("dialog.Cancel");
|
||||
const shareButton = APP.translation.generateTranslationHTML("dialog.Share");
|
||||
const backButton = APP.translation.generateTranslationHTML("dialog.Back");
|
||||
const linkError = APP.translation.generateTranslationHTML("dialog.preziLinkError");
|
||||
const i18nOptions = {url: defaultPreziLink};
|
||||
const defaultUrl = APP.translation.translateString(
|
||||
"defaultPreziLink", i18nOptions
|
||||
);
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
let dialog = messageHandler.openDialogWithStates({
|
||||
state0: {
|
||||
html: `
|
||||
<h2>${title}</h2>
|
||||
<input name="preziUrl" type="text"
|
||||
data-i18n="[placeholder]defaultPreziLink"
|
||||
data-i18n-options="${JSON.stringify(i18nOptions)}"
|
||||
placeholder="${defaultUrl}" autofocus>`,
|
||||
persistent: false,
|
||||
buttons: [
|
||||
{title: cancelButton, value: false},
|
||||
{title: shareButton, value: true}
|
||||
],
|
||||
focus: ':input:first',
|
||||
defaultButton: 1,
|
||||
submit: function (e, v, m, f) {
|
||||
e.preventDefault();
|
||||
if (!v) {
|
||||
reject('cancelled');
|
||||
dialog.close();
|
||||
return;
|
||||
}
|
||||
|
||||
let preziUrl = f.preziUrl;
|
||||
if (!preziUrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
let urlValue = encodeURI(UIUtil.escapeHtml(preziUrl));
|
||||
|
||||
if (!isPreziLink(urlValue)) {
|
||||
dialog.goToState('state1');
|
||||
return false;
|
||||
}
|
||||
|
||||
resolve(urlValue);
|
||||
dialog.close();
|
||||
}
|
||||
},
|
||||
|
||||
state1: {
|
||||
html: `<h2>${title}</h2> ${linkError}`,
|
||||
persistent: false,
|
||||
buttons: [
|
||||
{title: cancelButton, value: false},
|
||||
{title: backButton, value: true}
|
||||
],
|
||||
focus: ':input:first',
|
||||
defaultButton: 1,
|
||||
submit: function (e, v, m, f) {
|
||||
e.preventDefault();
|
||||
if (v === 0) {
|
||||
reject();
|
||||
dialog.close();
|
||||
} else {
|
||||
dialog.goToState('state0');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
export const PreziContainerType = "prezi";
|
||||
|
||||
/**
|
||||
* Container for Prezi iframe.
|
||||
*/
|
||||
class PreziContainer extends LargeContainer {
|
||||
|
||||
constructor ({preziId, isMy, slide, onSlideChanged}) {
|
||||
super();
|
||||
this.reloadBtn = $('#reloadPresentation');
|
||||
|
||||
let preziPlayer = new PreziPlayer(
|
||||
'presentation', {
|
||||
preziId,
|
||||
width: DEFAULT_WIDTH,
|
||||
height: DEFAULT_HEIGHT,
|
||||
controls: isMy,
|
||||
debug: true
|
||||
}
|
||||
);
|
||||
this.preziPlayer = preziPlayer;
|
||||
this.$iframe = $(preziPlayer.iframe);
|
||||
|
||||
this.$iframe.attr('id', preziId);
|
||||
|
||||
preziPlayer.on(PreziPlayer.EVENT_STATUS, function({value}) {
|
||||
console.log("prezi status", value);
|
||||
if (value == PreziPlayer.STATUS_CONTENT_READY && !isMy) {
|
||||
preziPlayer.flyToStep(slide);
|
||||
}
|
||||
});
|
||||
|
||||
preziPlayer.on(PreziPlayer.EVENT_CURRENT_STEP, function({value}) {
|
||||
console.log("event value", value);
|
||||
onSlideChanged(value);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Prezi slide.
|
||||
* @param {number} slide slide to show
|
||||
*/
|
||||
goToSlide (slide) {
|
||||
if (this.preziPlayer.getCurrentStep() === slide) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.preziPlayer.flyToStep(slide);
|
||||
|
||||
let animationStepsArray = this.preziPlayer.getAnimationCountOnSteps();
|
||||
if (!animationStepsArray) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < parseInt(animationStepsArray[slide]); i += 1) {
|
||||
this.preziPlayer.flyToStep(slide, i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show or hide "reload presentation" button.
|
||||
* @param {boolean} show
|
||||
*/
|
||||
showReloadBtn (show) {
|
||||
this.reloadBtn.css('display', show ? 'inline-block' : 'none');
|
||||
}
|
||||
|
||||
show () {
|
||||
return new Promise(resolve => {
|
||||
this.$iframe.fadeIn(300, () => {
|
||||
this.$iframe.css({opacity: 1});
|
||||
ToolbarToggler.dockToolbar(true);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
hide () {
|
||||
return new Promise(resolve => {
|
||||
this.$iframe.fadeOut(300, () => {
|
||||
this.$iframe.css({opacity: 0});
|
||||
this.showReloadBtn(false);
|
||||
ToolbarToggler.dockToolbar(false);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onHoverIn () {
|
||||
let rightOffset = window.innerWidth - this.$iframe.offset().left - this.$iframe.width();
|
||||
|
||||
this.showReloadBtn(true);
|
||||
this.reloadBtn.css('right', rightOffset);
|
||||
}
|
||||
|
||||
onHoverOut (event) {
|
||||
let e = event.toElement || event.relatedTarget;
|
||||
|
||||
if (e && e.id != 'reloadPresentation' && e.id != 'header') {
|
||||
this.showReloadBtn(false);
|
||||
}
|
||||
}
|
||||
|
||||
resize (containerWidth, containerHeight) {
|
||||
let height = containerHeight - FilmStrip.getFilmStripHeight();
|
||||
|
||||
let width = containerWidth;
|
||||
|
||||
if (height < width / aspectRatio) {
|
||||
width = Math.floor(height * aspectRatio);
|
||||
}
|
||||
|
||||
this.$iframe.width(width).height(height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close Prezi frame.
|
||||
*/
|
||||
close () {
|
||||
this.showReloadBtn(false);
|
||||
this.preziPlayer.destroy();
|
||||
this.$iframe.remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manager of Prezi frames.
|
||||
*/
|
||||
export default class PreziManager {
|
||||
constructor (emitter) {
|
||||
this.emitter = emitter;
|
||||
|
||||
this.userId = null;
|
||||
this.url = null;
|
||||
this.prezi = null;
|
||||
|
||||
$("#reloadPresentationLink").click(this.reloadPresentation.bind(this));
|
||||
}
|
||||
|
||||
get isPresenting () {
|
||||
return !!this.userId;
|
||||
}
|
||||
|
||||
get isMyPrezi () {
|
||||
return this.userId === APP.conference.localId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is currently sharing.
|
||||
* @param {string} id user id to check for
|
||||
*/
|
||||
isSharing (id) {
|
||||
return this.userId === id;
|
||||
}
|
||||
|
||||
handlePreziButtonClicked () {
|
||||
if (!this.isPresenting) {
|
||||
requestPreziLink().then(
|
||||
url => this.emitter.emit(UIEvents.SHARE_PREZI, url, 0),
|
||||
err => console.error('PREZI CANCELED', err)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isMyPrezi) {
|
||||
proposeToClosePrezi().then(() => this.emitter.emit(UIEvents.STOP_SHARING_PREZI));
|
||||
} else {
|
||||
notifyOtherIsSharingPrezi();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload current Prezi frame.
|
||||
*/
|
||||
reloadPresentation () {
|
||||
if (!this.prezi) {
|
||||
return;
|
||||
}
|
||||
let iframe = this.prezi.$iframe[0];
|
||||
iframe.src = iframe.src;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Prezi. Create new Prezi if there is no Prezi yet.
|
||||
* @param {string} id owner id
|
||||
* @param {string} url Prezi url
|
||||
* @param {number} slide slide to show
|
||||
*/
|
||||
showPrezi (id, url, slide) {
|
||||
if (!this.isPresenting) {
|
||||
this.createPrezi(id, url, slide);
|
||||
}
|
||||
|
||||
if (this.userId === id && this.url === url) {
|
||||
this.prezi.goToSlide(slide);
|
||||
} else {
|
||||
console.error(this.userId, id);
|
||||
console.error(this.url, url);
|
||||
throw new Error("unexpected presentation change");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new Prezi frame..
|
||||
* @param {string} id owner id
|
||||
* @param {string} url Prezi url
|
||||
* @param {number} slide slide to show
|
||||
*/
|
||||
createPrezi (id, url, slide) {
|
||||
console.log("presentation added", url);
|
||||
|
||||
this.userId = id;
|
||||
this.url = url;
|
||||
|
||||
let preziId = getPresentationId(url);
|
||||
let elementId = `participant_${id}_${preziId}`;
|
||||
|
||||
this.$thumb = $(VideoLayout.addRemoteVideoContainer(elementId));
|
||||
VideoLayout.resizeThumbnails();
|
||||
this.$thumb.css({
|
||||
'background-image': 'url(../images/avatarprezi.png)'
|
||||
}).click(() => VideoLayout.showLargeVideoContainer(PreziContainerType, true));
|
||||
|
||||
this.prezi = new PreziContainer({
|
||||
preziId,
|
||||
isMy: this.isMyPrezi,
|
||||
slide,
|
||||
onSlideChanged: newSlide => {
|
||||
if (this.isMyPrezi) {
|
||||
this.emitter.emit(UIEvents.SHARE_PREZI, url, newSlide);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
VideoLayout.addLargeVideoContainer(PreziContainerType, this.prezi);
|
||||
VideoLayout.showLargeVideoContainer(PreziContainerType, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close Prezi.
|
||||
* @param {string} id owner id
|
||||
*/
|
||||
removePrezi (id) {
|
||||
if (this.userId !== id) {
|
||||
throw new Error(`cannot close presentation from ${this.userId} instead of ${id}`);
|
||||
}
|
||||
|
||||
this.$thumb.remove();
|
||||
this.$thumb = null;
|
||||
|
||||
// wait until Prezi is hidden, then remove it
|
||||
VideoLayout.showLargeVideoContainer(PreziContainerType, false).then(() => {
|
||||
console.log("presentation removed", this.url);
|
||||
|
||||
VideoLayout.removeLargeVideoContainer(PreziContainerType);
|
||||
|
||||
this.userId = null;
|
||||
this.url = null;
|
||||
this.prezi.close();
|
||||
this.prezi = null;
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,290 +0,0 @@
|
|||
/* jshint -W101 */
|
||||
|
||||
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
PreziPlayer.API_VERSION = 1;
|
||||
PreziPlayer.CURRENT_STEP = 'currentStep';
|
||||
PreziPlayer.CURRENT_ANIMATION_STEP = 'currentAnimationStep';
|
||||
PreziPlayer.CURRENT_OBJECT = 'currentObject';
|
||||
PreziPlayer.STATUS_LOADING = 'loading';
|
||||
PreziPlayer.STATUS_READY = 'ready';
|
||||
PreziPlayer.STATUS_CONTENT_READY = 'contentready';
|
||||
PreziPlayer.EVENT_CURRENT_STEP = "currentStepChange";
|
||||
PreziPlayer.EVENT_CURRENT_ANIMATION_STEP = "currentAnimationStepChange";
|
||||
PreziPlayer.EVENT_CURRENT_OBJECT = "currentObjectChange";
|
||||
PreziPlayer.EVENT_STATUS = "statusChange";
|
||||
PreziPlayer.EVENT_PLAYING = "isAutoPlayingChange";
|
||||
PreziPlayer.EVENT_IS_MOVING = "isMovingChange";
|
||||
PreziPlayer.domain = "https://prezi.com";
|
||||
PreziPlayer.path = "/player/";
|
||||
PreziPlayer.players = {};
|
||||
PreziPlayer.binded_methods = ['changesHandler'];
|
||||
|
||||
PreziPlayer.createMultiplePlayers = function(optionArray){
|
||||
for(var i=0; i<optionArray.length; i++) {
|
||||
var optionSet = optionArray[i];
|
||||
new PreziPlayer(optionSet.id, optionSet);
|
||||
}
|
||||
};
|
||||
|
||||
PreziPlayer.messageReceived = function(event){
|
||||
var message, item, player;
|
||||
try {
|
||||
message = JSON.parse(event.data);
|
||||
if (message.id && (player = PreziPlayer.players[message.id])) {
|
||||
if (player.options.debug === true) {
|
||||
if (console && console.log)
|
||||
console.log('received', message);
|
||||
}
|
||||
if (message.type === "changes") {
|
||||
player.changesHandler(message);
|
||||
}
|
||||
for (var i = 0; i < player.callbacks.length; i++) {
|
||||
item = player.callbacks[i];
|
||||
if (item && message.type === item.event) {
|
||||
item.callback(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) { }
|
||||
};
|
||||
|
||||
/*jshint -W004 */
|
||||
function PreziPlayer(id, options) {
|
||||
/*jshint +W004 */
|
||||
var params, paramString = "", _this = this;
|
||||
if (PreziPlayer.players[id]){
|
||||
PreziPlayer.players[id].destroy();
|
||||
}
|
||||
for(var i=0; i<PreziPlayer.binded_methods.length; i++) {
|
||||
var method_name = PreziPlayer.binded_methods[i];
|
||||
_this[method_name] = __bind(_this[method_name], _this);
|
||||
}
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.values = {'status': PreziPlayer.STATUS_LOADING};
|
||||
this.values[PreziPlayer.CURRENT_STEP] = 0;
|
||||
this.values[PreziPlayer.CURRENT_ANIMATION_STEP] = 0;
|
||||
this.values[PreziPlayer.CURRENT_OBJECT] = null;
|
||||
this.callbacks = [];
|
||||
this.id = id;
|
||||
this.embedTo = document.getElementById(id);
|
||||
if (!this.embedTo) {
|
||||
throw "The element id is not available.";
|
||||
}
|
||||
this.iframe = document.createElement('iframe');
|
||||
params = [
|
||||
{ name: 'oid', value: options.preziId },
|
||||
{ name: 'explorable', value: options.explorable ? 1 : 0 },
|
||||
{ name: 'controls', value: options.controls ? 1 : 0 }
|
||||
];
|
||||
for (i=0; i<params.length; i++) {
|
||||
var param = params[i];
|
||||
paramString += (i===0 ? "?" : "&") + param.name + "=" + param.value;
|
||||
}
|
||||
this.iframe.src = PreziPlayer.domain + PreziPlayer.path + paramString;
|
||||
this.iframe.frameBorder = 0;
|
||||
this.iframe.scrolling = "no";
|
||||
this.iframe.width = options.width || 640;
|
||||
this.iframe.height = options.height || 480;
|
||||
this.embedTo.innerHTML = '';
|
||||
// JITSI: IN CASE SOMETHING GOES WRONG.
|
||||
try {
|
||||
this.embedTo.appendChild(this.iframe);
|
||||
}
|
||||
catch (err) {
|
||||
console.log("CATCH ERROR");
|
||||
}
|
||||
|
||||
// JITSI: Increase interval from 200 to 500, which fixes prezi
|
||||
// crashes for us.
|
||||
this.initPollInterval = setInterval(function(){
|
||||
_this.sendMessage({'action': 'init'});
|
||||
}, 500);
|
||||
PreziPlayer.players[id] = this;
|
||||
}
|
||||
|
||||
PreziPlayer.prototype.changesHandler = function(message) {
|
||||
var key, value, j, item;
|
||||
if (this.initPollInterval) {
|
||||
clearInterval(this.initPollInterval);
|
||||
this.initPollInterval = false;
|
||||
}
|
||||
for (key in message.data) {
|
||||
if (message.data.hasOwnProperty(key)){
|
||||
value = message.data[key];
|
||||
this.values[key] = value;
|
||||
for (j=0; j<this.callbacks.length; j++) {
|
||||
item = this.callbacks[j];
|
||||
if (item && item.event === key + "Change"){
|
||||
item.callback({type: item.event, value: value});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.destroy = function() {
|
||||
if (this.initPollInterval) {
|
||||
clearInterval(this.initPollInterval);
|
||||
this.initPollInterval = false;
|
||||
}
|
||||
this.embedTo.innerHTML = '';
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.sendMessage = function(message) {
|
||||
if (this.options.debug === true) {
|
||||
if (console && console.log) console.log('sent', message);
|
||||
}
|
||||
message.version = PreziPlayer.API_VERSION;
|
||||
message.id = this.id;
|
||||
return this.iframe.contentWindow.postMessage(JSON.stringify(message), '*');
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.nextStep = /* nextStep is DEPRECATED */
|
||||
PreziPlayer.prototype.flyToNextStep = function() {
|
||||
return this.sendMessage({
|
||||
'action': 'present',
|
||||
'data': ['moveToNextStep']
|
||||
});
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.previousStep = /* previousStep is DEPRECATED */
|
||||
PreziPlayer.prototype.flyToPreviousStep = function() {
|
||||
return this.sendMessage({
|
||||
'action': 'present',
|
||||
'data': ['moveToPrevStep']
|
||||
});
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.toStep = /* toStep is DEPRECATED */
|
||||
PreziPlayer.prototype.flyToStep = function(step, animation_step) {
|
||||
var obj = this;
|
||||
// check animation_step
|
||||
if (animation_step > 0 &&
|
||||
obj.values.animationCountOnSteps &&
|
||||
obj.values.animationCountOnSteps[step] <= animation_step) {
|
||||
animation_step = obj.values.animationCountOnSteps[step];
|
||||
}
|
||||
// jump to animation steps by calling flyToNextStep()
|
||||
function doAnimationSteps() {
|
||||
if (obj.values.isMoving) {
|
||||
setTimeout(doAnimationSteps, 100); // wait until the flight ends
|
||||
return;
|
||||
}
|
||||
while (animation_step-- > 0) {
|
||||
obj.flyToNextStep(); // do the animation steps
|
||||
}
|
||||
}
|
||||
setTimeout(doAnimationSteps, 200); // 200ms is the internal "reporting" time
|
||||
// jump to the step
|
||||
return this.sendMessage({
|
||||
'action': 'present',
|
||||
'data': ['moveToStep', step]
|
||||
});
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.toObject = /* toObject is DEPRECATED */
|
||||
PreziPlayer.prototype.flyToObject = function(objectId) {
|
||||
return this.sendMessage({
|
||||
'action': 'present',
|
||||
'data': ['moveToObject', objectId]
|
||||
});
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.play = function(defaultDelay) {
|
||||
return this.sendMessage({
|
||||
'action': 'present',
|
||||
'data': ['startAutoPlay', defaultDelay]
|
||||
});
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.stop = function() {
|
||||
return this.sendMessage({
|
||||
'action': 'present',
|
||||
'data': ['stopAutoPlay']
|
||||
});
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.pause = function(defaultDelay) {
|
||||
return this.sendMessage({
|
||||
'action': 'present',
|
||||
'data': ['pauseAutoPlay', defaultDelay]
|
||||
});
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.getCurrentStep = function() {
|
||||
return this.values.currentStep;
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.getCurrentAnimationStep = function() {
|
||||
return this.values.currentAnimationStep;
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.getCurrentObject = function() {
|
||||
return this.values.currentObject;
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.getStatus = function() {
|
||||
return this.values.status;
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.isPlaying = function() {
|
||||
return this.values.isAutoPlaying;
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.getStepCount = function() {
|
||||
return this.values.stepCount;
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.getAnimationCountOnSteps = function() {
|
||||
return this.values.animationCountOnSteps;
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.getTitle = function() {
|
||||
return this.values.title;
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.setDimensions = function(dims) {
|
||||
for (var parameter in dims) {
|
||||
this.iframe[parameter] = dims[parameter];
|
||||
}
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.getDimensions = function() {
|
||||
return {
|
||||
width: parseInt(this.iframe.width, 10),
|
||||
height: parseInt(this.iframe.height, 10)
|
||||
};
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.on = function(event, callback) {
|
||||
this.callbacks.push({
|
||||
event: event,
|
||||
callback: callback
|
||||
});
|
||||
};
|
||||
|
||||
PreziPlayer.prototype.off = function(event, callback) {
|
||||
var j, item;
|
||||
if (event === undefined) {
|
||||
this.callbacks = [];
|
||||
}
|
||||
j = this.callbacks.length;
|
||||
while (j--) {
|
||||
item = this.callbacks[j];
|
||||
if (item && item.event === event && (callback === undefined || item.callback === callback)){
|
||||
this.callbacks.splice(j, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener('message', PreziPlayer.messageReceived, false);
|
||||
} else {
|
||||
window.attachEvent('onmessage', PreziPlayer.messageReceived);
|
||||
}
|
||||
|
||||
window.PreziPlayer = PreziPlayer;
|
||||
|
||||
export default PreziPlayer;
|
|
@ -122,10 +122,6 @@ const buttonHandlers = {
|
|||
AnalyticsAdapter.sendEvent('toolbar.chat.toggled');
|
||||
emitter.emit(UIEvents.TOGGLE_CHAT);
|
||||
},
|
||||
"toolbar_button_prezi": function () {
|
||||
AnalyticsAdapter.sendEvent('toolbar.prezi.clicked');
|
||||
emitter.emit(UIEvents.PREZI_CLICKED);
|
||||
},
|
||||
"toolbar_button_etherpad": function () {
|
||||
AnalyticsAdapter.sendEvent('toolbar.etherpad.clicked');
|
||||
emitter.emit(UIEvents.ETHERPAD_CLICKED);
|
||||
|
@ -188,7 +184,6 @@ const defaultToolbarButtons = {
|
|||
'security': '#toolbar_button_security',
|
||||
'invite': '#toolbar_button_link',
|
||||
'chat': '#toolbar_button_chat',
|
||||
'prezi': '#toolbar_button_prezi',
|
||||
'etherpad': '#toolbar_button_etherpad',
|
||||
'fullscreen': '#toolbar_button_fullScreen',
|
||||
'settings': '#toolbar_button_settings',
|
||||
|
@ -246,15 +241,6 @@ const Toolbar = {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disables and enables some of the buttons.
|
||||
*/
|
||||
setupButtonsFromConfig () {
|
||||
if (!UIUtil.isButtonEnabled('prezi')) {
|
||||
$("#toolbar_button_prezi").css({display: "none"});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Unlocks the lock button state.
|
||||
*/
|
||||
|
|
|
@ -124,9 +124,7 @@
|
|||
|
||||
isButtonEnabled: function (name) {
|
||||
var isEnabled = interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
|
||||
if (name === 'prezi') {
|
||||
return isEnabled && !config.disablePrezi;
|
||||
} else if (name === 'recording') {
|
||||
if (name === 'recording') {
|
||||
return isEnabled && config.enableRecording;
|
||||
}
|
||||
return isEnabled;
|
||||
|
|
|
@ -10,7 +10,6 @@ import UIUtil from "../util/UIUtil";
|
|||
|
||||
import RemoteVideo from "./RemoteVideo";
|
||||
import LargeVideoManager, {VideoContainerType} from "./LargeVideo";
|
||||
import {PreziContainerType} from '../prezi/Prezi';
|
||||
import LocalVideo from "./LocalVideo";
|
||||
import PanelToggler from "../side_pannels/SidePanelToggler";
|
||||
|
||||
|
@ -361,11 +360,10 @@ var VideoLayout = {
|
|||
false, false, false, function() {$(videoelem).show();});
|
||||
|
||||
// Update the large video to the last added video only if there's no
|
||||
// current dominant, focused speaker or prezi playing or update it to
|
||||
// current dominant, focused speaker or update it to
|
||||
// the current dominant speaker.
|
||||
if ((!focusedVideoResourceJid &&
|
||||
!currentDominantSpeaker &&
|
||||
!this.isLargeContainerTypeVisible(PreziContainerType)) ||
|
||||
!currentDominantSpeaker) ||
|
||||
focusedVideoResourceJid === resourceJid ||
|
||||
(resourceJid &&
|
||||
currentDominantSpeaker === resourceJid)) {
|
||||
|
@ -793,10 +791,6 @@ var VideoLayout = {
|
|||
}
|
||||
},
|
||||
|
||||
addRemoteVideoContainer (id) {
|
||||
return RemoteVideo.createContainer(id);
|
||||
},
|
||||
|
||||
/**
|
||||
* Resizes the video area.
|
||||
*
|
||||
|
|
|
@ -20,10 +20,6 @@ export default {
|
|||
START_MUTED_CHANGED: "UI.start_muted_changed",
|
||||
AUDIO_MUTED: "UI.audio_muted",
|
||||
VIDEO_MUTED: "UI.video_muted",
|
||||
PREZI_CLICKED: "UI.prezi_clicked",
|
||||
SHARE_PREZI: "UI.share_prezi",
|
||||
PREZI_SLIDE_CHANGED: "UI.prezi_slide_changed",
|
||||
STOP_SHARING_PREZI: "UI.stop_sharing_prezi",
|
||||
ETHERPAD_CLICKED: "UI.etherpad_clicked",
|
||||
ROOM_LOCK_CLICKED: "UI.room_lock_clicked",
|
||||
USER_INVITED: "UI.user_invited",
|
||||
|
|
Loading…
Reference in New Issue