瀏覽代碼

Removes prezi.

j8
damencho 9 年之前
父節點
當前提交
4ff6d276ce

+ 1
- 1
README.md 查看文件

4
 
4
 
5
 You can also try it out yourself at https://meet.jit.si .
5
 You can also try it out yourself at https://meet.jit.si .
6
 
6
 
7
-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.
7
+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.
8
 
8
 
9
 ## Installation
9
 ## Installation
10
 
10
 

+ 1
- 33
conference.js 查看文件

27
 const Commands = {
27
 const Commands = {
28
     CONNECTION_QUALITY: "stats",
28
     CONNECTION_QUALITY: "stats",
29
     EMAIL: "email",
29
     EMAIL: "email",
30
-    ETHERPAD: "etherpad",
31
-    PREZI: "prezi",
32
-    STOP_PREZI: "stop-prezi"
30
+    ETHERPAD: "etherpad"
33
 };
31
 };
34
 
32
 
35
 /**
33
 /**
687
             console.log('USER %s LEFT', id, user);
685
             console.log('USER %s LEFT', id, user);
688
             APP.API.notifyUserLeft(id);
686
             APP.API.notifyUserLeft(id);
689
             APP.UI.removeUser(id, user.getDisplayName());
687
             APP.UI.removeUser(id, user.getDisplayName());
690
-            APP.UI.stopPrezi(id);
691
         });
688
         });
692
 
689
 
693
 
690
 
866
             APP.UI.initEtherpad(value);
863
             APP.UI.initEtherpad(value);
867
         });
864
         });
868
 
865
 
869
-        room.addCommandListener(Commands.PREZI, ({value, attributes}) => {
870
-            APP.UI.showPrezi(attributes.id, value, attributes.slide);
871
-        });
872
-
873
-        room.addCommandListener(Commands.STOP_PREZI, ({attributes}) => {
874
-            APP.UI.stopPrezi(attributes.id);
875
-        });
876
-
877
-        APP.UI.addListener(UIEvents.SHARE_PREZI, (url, slide) => {
878
-            console.log('Sharing Prezi %s slide %s', url, slide);
879
-            room.removeCommand(Commands.PREZI);
880
-            room.sendCommand(Commands.PREZI, {
881
-                value: url,
882
-                attributes: {
883
-                    id: room.myUserId(),
884
-                    slide
885
-                }
886
-            });
887
-        });
888
-
889
-        APP.UI.addListener(UIEvents.STOP_SHARING_PREZI, () => {
890
-            room.removeCommand(Commands.PREZI);
891
-            room.sendCommandOnce(Commands.STOP_PREZI, {
892
-                attributes: {
893
-                    id: room.myUserId()
894
-                }
895
-            });
896
-        });
897
-
898
         APP.UI.addListener(UIEvents.EMAIL_CHANGED, (email = '') => {
866
         APP.UI.addListener(UIEvents.EMAIL_CHANGED, (email = '') => {
899
             email = email.trim();
867
             email = email.trim();
900
 
868
 

+ 0
- 3
css/font.css 查看文件

63
 .icon-exit-full-screen:before {
63
 .icon-exit-full-screen:before {
64
 	content: "\e60e";
64
 	content: "\e60e";
65
 }
65
 }
66
-.icon-prezi:before {
67
-	content: "\e60c";
68
-}
69
 .icon-link:before {
66
 .icon-link:before {
70
 	content: "\e600";
67
 	content: "\e600";
71
 }
68
 }

+ 0
- 2
index.html 查看文件

122
                     <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">
122
                     <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">
123
                         <span id="unreadMessages"></span>
123
                         <span id="unreadMessages"></span>
124
                     </a>
124
                     </a>
125
-                    <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>
126
                     <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>
125
                     <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>
127
                     <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>
126
                     <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>
128
                     <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>
127
                     <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
             </div>
133
             </div>
135
             <div id="subject"></div>
134
             <div id="subject"></div>
136
         </div>
135
         </div>
137
-        <div id="reloadPresentation"><a id="reloadPresentationLink"><i title="Reload Prezi" class="fa fa-repeat fa-lg"></i></a></div>
138
         <div id="videospace">
136
         <div id="videospace">
139
 
137
 
140
             <div id="largeVideoContainer" class="videocontainer">
138
             <div id="largeVideoContainer" class="videocontainer">

+ 1
- 1
interface_config.js 查看文件

16
     INVITATION_POWERED_BY: true,
16
     INVITATION_POWERED_BY: true,
17
     DOMINANT_SPEAKER_AVATAR_SIZE: 100,
17
     DOMINANT_SPEAKER_AVATAR_SIZE: 100,
18
     TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop',
18
     TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop',
19
-        'recording', 'security', 'invite', 'chat', 'prezi', 'etherpad',
19
+        'recording', 'security', 'invite', 'chat', 'etherpad',
20
         'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip',
20
         'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip',
21
         'contacts'],
21
         'contacts'],
22
     // Determines how the video would fit the screen. 'both' would fit the whole
22
     // Determines how the video would fit the screen. 'both' would fit the whole

+ 0
- 7
lang/main.json 查看文件

9
     "me": "me",
9
     "me": "me",
10
     "speaker": "Speaker",
10
     "speaker": "Speaker",
11
     "defaultNickname": "ex. __name__",
11
     "defaultNickname": "ex. __name__",
12
-    "defaultPreziLink": "e.g. __url__",
13
     "welcomepage":{
12
     "welcomepage":{
14
         "go": "GO",
13
         "go": "GO",
15
         "roomname": "Enter room name",
14
         "roomname": "Enter room name",
55
         "lock": "Lock / unlock room",
54
         "lock": "Lock / unlock room",
56
         "invite": "Invite others",
55
         "invite": "Invite others",
57
         "chat": "Open / close chat",
56
         "chat": "Open / close chat",
58
-        "prezi": "Share Prezi",
59
         "etherpad": "Shared document",
57
         "etherpad": "Shared document",
60
         "sharescreen": "Share screen",
58
         "sharescreen": "Share screen",
61
         "fullscreen": "Enter / Exit Full Screen",
59
         "fullscreen": "Enter / Exit Full Screen",
159
         "defaultError": "There was some kind of error",
157
         "defaultError": "There was some kind of error",
160
         "passwordRequired": "Password required",
158
         "passwordRequired": "Password required",
161
         "Ok": "Ok",
159
         "Ok": "Ok",
162
-        "removePreziTitle": "Remove Prezi",
163
-        "removePreziMsg": "Are you sure you would like to remove your Prezi?",
164
-        "sharePreziTitle": "Share a Prezi",
165
-        "sharePreziMsg": "Another participant is already sharing a Prezi. This conference allows only one Prezi at a time.",
166
         "Remove": "Remove",
160
         "Remove": "Remove",
167
         "WaitingForHost": "Waiting for the host ...",
161
         "WaitingForHost": "Waiting for the host ...",
168
         "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.",
162
         "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
         "hungUp": "You hung up",
169
         "hungUp": "You hung up",
176
         "joinAgain": "Join again",
170
         "joinAgain": "Join again",
177
         "Share": "Share",
171
         "Share": "Share",
178
-        "preziLinkError": "Please provide a correct prezi link.",
179
         "Save": "Save",
172
         "Save": "Save",
180
         "recordingToken": "Enter recording token",
173
         "recordingToken": "Enter recording token",
181
         "Dial": "Dial",
174
         "Dial": "Dial",

+ 0
- 27
modules/UI/UI.js 查看文件

12
 import UIUtil from "./util/UIUtil";
12
 import UIUtil from "./util/UIUtil";
13
 import UIEvents from "../../service/UI/UIEvents";
13
 import UIEvents from "../../service/UI/UIEvents";
14
 import CQEvents from '../../service/connectionquality/CQEvents';
14
 import CQEvents from '../../service/connectionquality/CQEvents';
15
-import PreziManager from './prezi/Prezi';
16
 import EtherpadManager from './etherpad/Etherpad';
15
 import EtherpadManager from './etherpad/Etherpad';
17
 
16
 
18
 import VideoLayout from "./videolayout/VideoLayout";
17
 import VideoLayout from "./videolayout/VideoLayout";
30
 var eventEmitter = new EventEmitter();
29
 var eventEmitter = new EventEmitter();
31
 UI.eventEmitter = eventEmitter;
30
 UI.eventEmitter = eventEmitter;
32
 
31
 
33
-let preziManager;
34
 let etherpadManager;
32
 let etherpadManager;
35
 
33
 
36
 /**
34
 /**
96
  */
94
  */
97
 function setupToolbars() {
95
 function setupToolbars() {
98
     Toolbar.init(eventEmitter);
96
     Toolbar.init(eventEmitter);
99
-    Toolbar.setupButtonsFromConfig();
100
     BottomToolbar.setupListeners(eventEmitter);
97
     BottomToolbar.setupListeners(eventEmitter);
101
 }
98
 }
102
 
99
 
256
  * Setup some UI event listeners.
253
  * Setup some UI event listeners.
257
  */
254
  */
258
 function registerListeners() {
255
 function registerListeners() {
259
-    UI.addListener(UIEvents.PREZI_CLICKED, function () {
260
-        preziManager.handlePreziButtonClicked();
261
-    });
262
 
256
 
263
     UI.addListener(UIEvents.ETHERPAD_CLICKED, function () {
257
     UI.addListener(UIEvents.ETHERPAD_CLICKED, function () {
264
         if (etherpadManager) {
258
         if (etherpadManager) {
337
     ContactList.init(eventEmitter);
331
     ContactList.init(eventEmitter);
338
 
332
 
339
     bindEvents();
333
     bindEvents();
340
-    preziManager = new PreziManager(eventEmitter);
341
     if (!interfaceConfig.filmStripOnly) {
334
     if (!interfaceConfig.filmStripOnly) {
342
 
335
 
343
         $("#videospace").mousemove(function () {
336
         $("#videospace").mousemove(function () {
998
     }
991
     }
999
 };
992
 };
1000
 
993
 
1001
-/**
1002
- * Show Prezi from the user.
1003
- * @param {string} userId user id
1004
- * @param {string} url Prezi url
1005
- * @param {number} slide slide to show
1006
- */
1007
-UI.showPrezi = function (userId, url, slide) {
1008
-    preziManager.showPrezi(userId, url, slide);
1009
-};
1010
-
1011
-/**
1012
- * Stop showing Prezi from the user.
1013
- * @param {string} userId user id
1014
- */
1015
-UI.stopPrezi = function (userId) {
1016
-  if (preziManager.isSharing(userId)) {
1017
-      preziManager.removePrezi(userId);
1018
-  }
1019
-};
1020
-
1021
 UI.onStartMutedChanged = function (startAudioMuted, startVideoMuted) {
994
 UI.onStartMutedChanged = function (startAudioMuted, startVideoMuted) {
1022
     SettingsMenu.updateStartMutedBox(startAudioMuted, startVideoMuted);
995
     SettingsMenu.updateStartMutedBox(startAudioMuted, startVideoMuted);
1023
 };
996
 };

+ 0
- 448
modules/UI/prezi/Prezi.js 查看文件

1
-/* global $, APP */
2
-/* jshint -W101 */
3
-
4
-import VideoLayout from "../videolayout/VideoLayout";
5
-import LargeContainer from '../videolayout/LargeContainer';
6
-import PreziPlayer from './PreziPlayer';
7
-import UIUtil from '../util/UIUtil';
8
-import UIEvents from '../../../service/UI/UIEvents';
9
-import messageHandler from '../util/MessageHandler';
10
-import ToolbarToggler from "../toolbars/ToolbarToggler";
11
-import SidePanelToggler from "../side_pannels/SidePanelToggler";
12
-import FilmStrip from '../videolayout/FilmStrip';
13
-
14
-/**
15
- * Example of Prezi link.
16
- */
17
-const defaultPreziLink = "http://prezi.com/wz7vhjycl7e6/my-prezi";
18
-const alphanumRegex = /^[a-z0-9-_\/&\?=;]+$/i;
19
-/**
20
- * Default aspect ratio for Prezi frame.
21
- */
22
-const aspectRatio = 16.0 / 9.0;
23
-
24
-/**
25
- * Default Prezi frame width.
26
- */
27
-const DEFAULT_WIDTH = 640;
28
-/**
29
- * Default Prezi frame height.
30
- */
31
-const DEFAULT_HEIGHT = 480;
32
-
33
-/**
34
- * Indicates if the given string is an alphanumeric string.
35
- * Note that some special characters are also allowed (-, _ , /, &, ?, =, ;) for the
36
- * purpose of checking URIs.
37
- * @param {string} unsafeText string to check
38
- * @returns {boolean}
39
- */
40
-function isAlphanumeric(unsafeText) {
41
-    return alphanumRegex.test(unsafeText);
42
-}
43
-
44
-/**
45
- * Returns the presentation id from the given url.
46
- * @param {string} url Prezi link
47
- * @returns {string} presentation id
48
- */
49
-function getPresentationId (url) {
50
-    let presId = url.substring(url.indexOf("prezi.com/") + 10);
51
-    return presId.substring(0, presId.indexOf('/'));
52
-}
53
-
54
-/**
55
- * Checks if given string is Prezi url.
56
- * @param {string} url string to check.
57
- * @returns {boolean}
58
- */
59
-function isPreziLink(url) {
60
-    if (url.indexOf('http://prezi.com/') !== 0 && url.indexOf('https://prezi.com/') !== 0) {
61
-        return false;
62
-    }
63
-
64
-    let presId = url.substring(url.indexOf("prezi.com/") + 10);
65
-    if (!isAlphanumeric(presId) || presId.indexOf('/') < 2) {
66
-        return false;
67
-    }
68
-
69
-    return true;
70
-}
71
-
72
-/**
73
- * Notify user that other user if already sharing Prezi.
74
- */
75
-function notifyOtherIsSharingPrezi() {
76
-    messageHandler.openMessageDialog(
77
-        "dialog.sharePreziTitle",
78
-        "dialog.sharePreziMsg"
79
-    );
80
-}
81
-
82
-/**
83
- * Ask user if he want to close Prezi he's sharing.
84
- */
85
-function proposeToClosePrezi() {
86
-    return new Promise(function (resolve, reject) {
87
-        messageHandler.openTwoButtonDialog(
88
-            "dialog.removePreziTitle",
89
-            null,
90
-            "dialog.removePreziMsg",
91
-            null,
92
-            false,
93
-            "dialog.Remove",
94
-            function(e,v,m,f) {
95
-                if (v) {
96
-                    resolve();
97
-                } else {
98
-                    reject();
99
-                }
100
-            }
101
-        );
102
-
103
-    });
104
-}
105
-
106
-/**
107
- * Ask user for Prezi url to share with others.
108
- * Dialog validates client input to allow only Prezi urls.
109
- */
110
-function requestPreziLink() {
111
-    const title = APP.translation.generateTranslationHTML("dialog.sharePreziTitle");
112
-    const cancelButton = APP.translation.generateTranslationHTML("dialog.Cancel");
113
-    const shareButton = APP.translation.generateTranslationHTML("dialog.Share");
114
-    const backButton = APP.translation.generateTranslationHTML("dialog.Back");
115
-    const linkError = APP.translation.generateTranslationHTML("dialog.preziLinkError");
116
-    const i18nOptions = {url: defaultPreziLink};
117
-    const defaultUrl = APP.translation.translateString(
118
-        "defaultPreziLink", i18nOptions
119
-    );
120
-
121
-    return new Promise(function (resolve, reject) {
122
-        let dialog = messageHandler.openDialogWithStates({
123
-            state0: {
124
-                html:  `
125
-                    <h2>${title}</h2>
126
-                    <input name="preziUrl" type="text"
127
-                           data-i18n="[placeholder]defaultPreziLink"
128
-                           data-i18n-options="${JSON.stringify(i18nOptions)}"
129
-                           placeholder="${defaultUrl}" autofocus>`,
130
-                persistent: false,
131
-                buttons: [
132
-                    {title: cancelButton, value: false},
133
-                    {title: shareButton, value: true}
134
-                ],
135
-                focus: ':input:first',
136
-                defaultButton: 1,
137
-                submit: function (e, v, m, f) {
138
-                    e.preventDefault();
139
-                    if (!v) {
140
-                        reject('cancelled');
141
-                        dialog.close();
142
-                        return;
143
-                    }
144
-
145
-                    let preziUrl = f.preziUrl;
146
-                    if (!preziUrl) {
147
-                        return;
148
-                    }
149
-
150
-                    let urlValue = encodeURI(UIUtil.escapeHtml(preziUrl));
151
-
152
-                    if (!isPreziLink(urlValue)) {
153
-                        dialog.goToState('state1');
154
-                        return false;
155
-                    }
156
-
157
-                    resolve(urlValue);
158
-                    dialog.close();
159
-                }
160
-            },
161
-
162
-            state1: {
163
-                html: `<h2>${title}</h2> ${linkError}`,
164
-                persistent: false,
165
-                buttons: [
166
-                    {title: cancelButton, value: false},
167
-                    {title: backButton, value: true}
168
-                ],
169
-                focus: ':input:first',
170
-                defaultButton: 1,
171
-                submit: function (e, v, m, f) {
172
-                    e.preventDefault();
173
-                    if (v === 0) {
174
-                        reject();
175
-                        dialog.close();
176
-                    } else {
177
-                        dialog.goToState('state0');
178
-                    }
179
-                }
180
-            }
181
-        });
182
-
183
-    });
184
-}
185
-
186
-export const PreziContainerType = "prezi";
187
-
188
-/**
189
- * Container for Prezi iframe.
190
- */
191
-class PreziContainer extends LargeContainer {
192
-
193
-    constructor ({preziId, isMy, slide, onSlideChanged}) {
194
-        super();
195
-        this.reloadBtn = $('#reloadPresentation');
196
-
197
-        let preziPlayer = new PreziPlayer(
198
-            'presentation', {
199
-                preziId,
200
-                width: DEFAULT_WIDTH,
201
-                height: DEFAULT_HEIGHT,
202
-                controls: isMy,
203
-                debug: true
204
-            }
205
-        );
206
-        this.preziPlayer = preziPlayer;
207
-        this.$iframe = $(preziPlayer.iframe);
208
-
209
-        this.$iframe.attr('id', preziId);
210
-
211
-        preziPlayer.on(PreziPlayer.EVENT_STATUS, function({value}) {
212
-            console.log("prezi status", value);
213
-            if (value == PreziPlayer.STATUS_CONTENT_READY && !isMy) {
214
-                preziPlayer.flyToStep(slide);
215
-            }
216
-        });
217
-
218
-        preziPlayer.on(PreziPlayer.EVENT_CURRENT_STEP, function({value}) {
219
-            console.log("event value", value);
220
-            onSlideChanged(value);
221
-        });
222
-    }
223
-
224
-    /**
225
-     * Change Prezi slide.
226
-     * @param {number} slide slide to show
227
-     */
228
-    goToSlide (slide) {
229
-        if (this.preziPlayer.getCurrentStep() === slide) {
230
-            return;
231
-        }
232
-
233
-        this.preziPlayer.flyToStep(slide);
234
-
235
-        let animationStepsArray = this.preziPlayer.getAnimationCountOnSteps();
236
-        if (!animationStepsArray) {
237
-            return;
238
-        }
239
-
240
-        for (var i = 0; i < parseInt(animationStepsArray[slide]); i += 1) {
241
-            this.preziPlayer.flyToStep(slide, i);
242
-        }
243
-    }
244
-
245
-    /**
246
-     * Show or hide "reload presentation" button.
247
-     * @param {boolean} show
248
-     */
249
-    showReloadBtn (show) {
250
-        this.reloadBtn.css('display', show ? 'inline-block' : 'none');
251
-    }
252
-
253
-    show () {
254
-        return new Promise(resolve => {
255
-            this.$iframe.fadeIn(300, () => {
256
-                this.$iframe.css({opacity: 1});
257
-                ToolbarToggler.dockToolbar(true);
258
-                resolve();
259
-            });
260
-        });
261
-    }
262
-
263
-    hide () {
264
-        return new Promise(resolve => {
265
-            this.$iframe.fadeOut(300, () => {
266
-                this.$iframe.css({opacity: 0});
267
-                this.showReloadBtn(false);
268
-                ToolbarToggler.dockToolbar(false);
269
-                resolve();
270
-            });
271
-        });
272
-    }
273
-
274
-    onHoverIn () {
275
-        let rightOffset = window.innerWidth - this.$iframe.offset().left - this.$iframe.width();
276
-
277
-        this.showReloadBtn(true);
278
-        this.reloadBtn.css('right', rightOffset);
279
-    }
280
-
281
-    onHoverOut (event) {
282
-        let e = event.toElement || event.relatedTarget;
283
-
284
-        if (e && e.id != 'reloadPresentation' && e.id != 'header') {
285
-            this.showReloadBtn(false);
286
-        }
287
-    }
288
-
289
-    resize (containerWidth, containerHeight) {
290
-        let height = containerHeight - FilmStrip.getFilmStripHeight();
291
-
292
-        let width = containerWidth;
293
-
294
-        if (height < width / aspectRatio) {
295
-            width = Math.floor(height * aspectRatio);
296
-        }
297
-
298
-        this.$iframe.width(width).height(height);
299
-    }
300
-
301
-    /**
302
-     * Close Prezi frame.
303
-     */
304
-    close () {
305
-        this.showReloadBtn(false);
306
-        this.preziPlayer.destroy();
307
-        this.$iframe.remove();
308
-    }
309
-}
310
-
311
-/**
312
- * Manager of Prezi frames.
313
- */
314
-export default class PreziManager {
315
-    constructor (emitter) {
316
-        this.emitter = emitter;
317
-
318
-        this.userId = null;
319
-        this.url = null;
320
-        this.prezi = null;
321
-
322
-        $("#reloadPresentationLink").click(this.reloadPresentation.bind(this));
323
-    }
324
-
325
-    get isPresenting () {
326
-        return !!this.userId;
327
-    }
328
-
329
-    get isMyPrezi () {
330
-        return this.userId === APP.conference.localId;
331
-    }
332
-
333
-    /**
334
-     * Check if user is currently sharing.
335
-     * @param {string} id user id to check for
336
-     */
337
-    isSharing (id) {
338
-        return this.userId === id;
339
-    }
340
-
341
-    handlePreziButtonClicked () {
342
-        if (!this.isPresenting) {
343
-            requestPreziLink().then(
344
-                url => this.emitter.emit(UIEvents.SHARE_PREZI, url, 0),
345
-                err => console.error('PREZI CANCELED', err)
346
-            );
347
-            return;
348
-        }
349
-
350
-        if (this.isMyPrezi) {
351
-            proposeToClosePrezi().then(() => this.emitter.emit(UIEvents.STOP_SHARING_PREZI));
352
-        } else {
353
-            notifyOtherIsSharingPrezi();
354
-        }
355
-    }
356
-
357
-    /**
358
-     * Reload current Prezi frame.
359
-     */
360
-    reloadPresentation () {
361
-        if (!this.prezi) {
362
-            return;
363
-        }
364
-        let iframe = this.prezi.$iframe[0];
365
-        iframe.src = iframe.src;
366
-    }
367
-
368
-    /**
369
-     * Show Prezi. Create new Prezi if there is no Prezi yet.
370
-     * @param {string} id owner id
371
-     * @param {string} url Prezi url
372
-     * @param {number} slide slide to show
373
-     */
374
-    showPrezi (id, url, slide) {
375
-        if (!this.isPresenting) {
376
-            this.createPrezi(id, url, slide);
377
-        }
378
-
379
-        if (this.userId === id && this.url === url) {
380
-            this.prezi.goToSlide(slide);
381
-        } else {
382
-            console.error(this.userId, id);
383
-            console.error(this.url, url);
384
-            throw new Error("unexpected presentation change");
385
-        }
386
-    }
387
-
388
-    /**
389
-     * Create new Prezi frame..
390
-     * @param {string} id owner id
391
-     * @param {string} url Prezi url
392
-     * @param {number} slide slide to show
393
-     */
394
-    createPrezi (id, url, slide) {
395
-        console.log("presentation added", url);
396
-
397
-        this.userId = id;
398
-        this.url = url;
399
-
400
-        let preziId = getPresentationId(url);
401
-        let elementId = `participant_${id}_${preziId}`;
402
-
403
-        this.$thumb = $(VideoLayout.addRemoteVideoContainer(elementId));
404
-        VideoLayout.resizeThumbnails();
405
-        this.$thumb.css({
406
-            'background-image': 'url(../images/avatarprezi.png)'
407
-        }).click(() => VideoLayout.showLargeVideoContainer(PreziContainerType, true));
408
-
409
-        this.prezi = new PreziContainer({
410
-            preziId,
411
-            isMy: this.isMyPrezi,
412
-            slide,
413
-            onSlideChanged: newSlide => {
414
-                if (this.isMyPrezi) {
415
-                    this.emitter.emit(UIEvents.SHARE_PREZI, url, newSlide);
416
-                }
417
-            }
418
-        });
419
-
420
-        VideoLayout.addLargeVideoContainer(PreziContainerType, this.prezi);
421
-        VideoLayout.showLargeVideoContainer(PreziContainerType, true);
422
-    }
423
-
424
-    /**
425
-     * Close Prezi.
426
-     * @param {string} id owner id
427
-     */
428
-    removePrezi (id) {
429
-        if (this.userId !== id) {
430
-            throw new Error(`cannot close presentation from ${this.userId} instead of ${id}`);
431
-        }
432
-
433
-        this.$thumb.remove();
434
-        this.$thumb = null;
435
-
436
-        // wait until Prezi is hidden, then remove it
437
-        VideoLayout.showLargeVideoContainer(PreziContainerType, false).then(() => {
438
-            console.log("presentation removed", this.url);
439
-
440
-            VideoLayout.removeLargeVideoContainer(PreziContainerType);
441
-
442
-            this.userId = null;
443
-            this.url = null;
444
-            this.prezi.close();
445
-            this.prezi = null;
446
-        });
447
-    }
448
-}

+ 0
- 290
modules/UI/prezi/PreziPlayer.js 查看文件

1
-/* jshint -W101 */
2
-
3
-var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
4
-
5
-PreziPlayer.API_VERSION = 1;
6
-PreziPlayer.CURRENT_STEP = 'currentStep';
7
-PreziPlayer.CURRENT_ANIMATION_STEP = 'currentAnimationStep';
8
-PreziPlayer.CURRENT_OBJECT = 'currentObject';
9
-PreziPlayer.STATUS_LOADING = 'loading';
10
-PreziPlayer.STATUS_READY = 'ready';
11
-PreziPlayer.STATUS_CONTENT_READY = 'contentready';
12
-PreziPlayer.EVENT_CURRENT_STEP = "currentStepChange";
13
-PreziPlayer.EVENT_CURRENT_ANIMATION_STEP = "currentAnimationStepChange";
14
-PreziPlayer.EVENT_CURRENT_OBJECT = "currentObjectChange";
15
-PreziPlayer.EVENT_STATUS = "statusChange";
16
-PreziPlayer.EVENT_PLAYING = "isAutoPlayingChange";
17
-PreziPlayer.EVENT_IS_MOVING = "isMovingChange";
18
-PreziPlayer.domain = "https://prezi.com";
19
-PreziPlayer.path = "/player/";
20
-PreziPlayer.players = {};
21
-PreziPlayer.binded_methods = ['changesHandler'];
22
-
23
-PreziPlayer.createMultiplePlayers = function(optionArray){
24
-    for(var i=0; i<optionArray.length; i++) {
25
-        var optionSet = optionArray[i];
26
-        new PreziPlayer(optionSet.id, optionSet);
27
-    }
28
-};
29
-
30
-PreziPlayer.messageReceived = function(event){
31
-    var message, item, player;
32
-    try {
33
-        message = JSON.parse(event.data);
34
-        if (message.id && (player = PreziPlayer.players[message.id])) {
35
-            if (player.options.debug === true) {
36
-                if (console && console.log)
37
-                    console.log('received', message);
38
-            }
39
-            if (message.type === "changes") {
40
-                player.changesHandler(message);
41
-            }
42
-            for (var i = 0; i < player.callbacks.length; i++) {
43
-                item = player.callbacks[i];
44
-                if (item && message.type === item.event) {
45
-                    item.callback(message);
46
-                }
47
-            }
48
-        }
49
-    } catch (e) { }
50
-};
51
-
52
-/*jshint -W004 */
53
-function PreziPlayer(id, options) {
54
-    /*jshint +W004 */
55
-    var params, paramString = "", _this = this;
56
-    if (PreziPlayer.players[id]){
57
-        PreziPlayer.players[id].destroy();
58
-    }
59
-    for(var i=0; i<PreziPlayer.binded_methods.length; i++) {
60
-        var method_name = PreziPlayer.binded_methods[i];
61
-        _this[method_name] = __bind(_this[method_name], _this);
62
-    }
63
-    options = options || {};
64
-    this.options = options;
65
-    this.values = {'status': PreziPlayer.STATUS_LOADING};
66
-    this.values[PreziPlayer.CURRENT_STEP] = 0;
67
-    this.values[PreziPlayer.CURRENT_ANIMATION_STEP] = 0;
68
-    this.values[PreziPlayer.CURRENT_OBJECT] = null;
69
-    this.callbacks = [];
70
-    this.id = id;
71
-    this.embedTo = document.getElementById(id);
72
-    if (!this.embedTo) {
73
-        throw "The element id is not available.";
74
-    }
75
-    this.iframe = document.createElement('iframe');
76
-    params = [
77
-        { name: 'oid', value: options.preziId },
78
-        { name: 'explorable', value: options.explorable ? 1 : 0 },
79
-        { name: 'controls', value: options.controls ? 1 : 0 }
80
-    ];
81
-    for (i=0; i<params.length; i++) {
82
-        var param = params[i];
83
-        paramString += (i===0 ? "?" : "&") + param.name + "=" + param.value;
84
-    }
85
-    this.iframe.src = PreziPlayer.domain + PreziPlayer.path + paramString;
86
-    this.iframe.frameBorder = 0;
87
-    this.iframe.scrolling = "no";
88
-    this.iframe.width = options.width || 640;
89
-    this.iframe.height = options.height || 480;
90
-    this.embedTo.innerHTML = '';
91
-    // JITSI: IN CASE SOMETHING GOES WRONG.
92
-    try {
93
-        this.embedTo.appendChild(this.iframe);
94
-    }
95
-    catch (err) {
96
-        console.log("CATCH ERROR");
97
-    }
98
-
99
-    // JITSI: Increase interval from 200 to 500, which fixes prezi
100
-    // crashes for us.
101
-    this.initPollInterval = setInterval(function(){
102
-        _this.sendMessage({'action': 'init'});
103
-    }, 500);
104
-    PreziPlayer.players[id] = this;
105
-}
106
-
107
-PreziPlayer.prototype.changesHandler = function(message) {
108
-    var key, value, j, item;
109
-    if (this.initPollInterval) {
110
-        clearInterval(this.initPollInterval);
111
-        this.initPollInterval = false;
112
-    }
113
-    for (key in message.data) {
114
-        if (message.data.hasOwnProperty(key)){
115
-            value = message.data[key];
116
-            this.values[key] = value;
117
-            for (j=0; j<this.callbacks.length; j++) {
118
-                item = this.callbacks[j];
119
-                if (item && item.event === key + "Change"){
120
-                    item.callback({type: item.event, value: value});
121
-                }
122
-            }
123
-        }
124
-    }
125
-};
126
-
127
-PreziPlayer.prototype.destroy = function() {
128
-    if (this.initPollInterval) {
129
-        clearInterval(this.initPollInterval);
130
-        this.initPollInterval = false;
131
-    }
132
-    this.embedTo.innerHTML = '';
133
-};
134
-
135
-PreziPlayer.prototype.sendMessage = function(message) {
136
-    if (this.options.debug === true) {
137
-        if (console && console.log) console.log('sent', message);
138
-    }
139
-    message.version = PreziPlayer.API_VERSION;
140
-    message.id = this.id;
141
-    return this.iframe.contentWindow.postMessage(JSON.stringify(message), '*');
142
-};
143
-
144
-PreziPlayer.prototype.nextStep = /* nextStep is DEPRECATED */
145
-PreziPlayer.prototype.flyToNextStep = function() {
146
-    return this.sendMessage({
147
-        'action': 'present',
148
-        'data': ['moveToNextStep']
149
-    });
150
-};
151
-
152
-PreziPlayer.prototype.previousStep = /* previousStep is DEPRECATED */
153
-PreziPlayer.prototype.flyToPreviousStep = function() {
154
-    return this.sendMessage({
155
-        'action': 'present',
156
-        'data': ['moveToPrevStep']
157
-    });
158
-};
159
-
160
-PreziPlayer.prototype.toStep = /* toStep is DEPRECATED */
161
-PreziPlayer.prototype.flyToStep = function(step, animation_step) {
162
-    var obj = this;
163
-    // check animation_step
164
-    if (animation_step > 0 &&
165
-        obj.values.animationCountOnSteps &&
166
-        obj.values.animationCountOnSteps[step] <= animation_step) {
167
-        animation_step = obj.values.animationCountOnSteps[step];
168
-    }
169
-    // jump to animation steps by calling flyToNextStep()
170
-    function doAnimationSteps() {
171
-        if (obj.values.isMoving) {
172
-            setTimeout(doAnimationSteps, 100); // wait until the flight ends
173
-            return;
174
-        }
175
-        while (animation_step-- > 0) {
176
-            obj.flyToNextStep(); // do the animation steps
177
-        }
178
-    }
179
-    setTimeout(doAnimationSteps, 200); // 200ms is the internal "reporting" time
180
-    // jump to the step
181
-    return this.sendMessage({
182
-        'action': 'present',
183
-        'data': ['moveToStep', step]
184
-    });
185
-};
186
-
187
-PreziPlayer.prototype.toObject = /* toObject is DEPRECATED */
188
-PreziPlayer.prototype.flyToObject = function(objectId) {
189
-    return this.sendMessage({
190
-        'action': 'present',
191
-        'data': ['moveToObject', objectId]
192
-    });
193
-};
194
-
195
-PreziPlayer.prototype.play = function(defaultDelay) {
196
-    return this.sendMessage({
197
-        'action': 'present',
198
-        'data': ['startAutoPlay', defaultDelay]
199
-    });
200
-};
201
-
202
-PreziPlayer.prototype.stop = function() {
203
-    return this.sendMessage({
204
-        'action': 'present',
205
-        'data': ['stopAutoPlay']
206
-    });
207
-};
208
-
209
-PreziPlayer.prototype.pause = function(defaultDelay) {
210
-    return this.sendMessage({
211
-        'action': 'present',
212
-        'data': ['pauseAutoPlay', defaultDelay]
213
-    });
214
-};
215
-
216
-PreziPlayer.prototype.getCurrentStep = function() {
217
-    return this.values.currentStep;
218
-};
219
-
220
-PreziPlayer.prototype.getCurrentAnimationStep = function() {
221
-    return this.values.currentAnimationStep;
222
-};
223
-
224
-PreziPlayer.prototype.getCurrentObject = function() {
225
-    return this.values.currentObject;
226
-};
227
-
228
-PreziPlayer.prototype.getStatus = function() {
229
-    return this.values.status;
230
-};
231
-
232
-PreziPlayer.prototype.isPlaying = function() {
233
-    return this.values.isAutoPlaying;
234
-};
235
-
236
-PreziPlayer.prototype.getStepCount = function() {
237
-    return this.values.stepCount;
238
-};
239
-
240
-PreziPlayer.prototype.getAnimationCountOnSteps = function() {
241
-    return this.values.animationCountOnSteps;
242
-};
243
-
244
-PreziPlayer.prototype.getTitle = function() {
245
-    return this.values.title;
246
-};
247
-
248
-PreziPlayer.prototype.setDimensions = function(dims) {
249
-    for (var parameter in dims) {
250
-        this.iframe[parameter] = dims[parameter];
251
-    }
252
-};
253
-
254
-PreziPlayer.prototype.getDimensions = function() {
255
-    return {
256
-        width: parseInt(this.iframe.width, 10),
257
-        height: parseInt(this.iframe.height, 10)
258
-    };
259
-};
260
-
261
-PreziPlayer.prototype.on = function(event, callback) {
262
-    this.callbacks.push({
263
-        event: event,
264
-        callback: callback
265
-    });
266
-};
267
-
268
-PreziPlayer.prototype.off = function(event, callback) {
269
-    var j, item;
270
-    if (event === undefined) {
271
-        this.callbacks = [];
272
-    }
273
-    j = this.callbacks.length;
274
-    while (j--) {
275
-        item = this.callbacks[j];
276
-        if (item && item.event === event && (callback === undefined || item.callback === callback)){
277
-            this.callbacks.splice(j, 1);
278
-        }
279
-    }
280
-};
281
-
282
-if (window.addEventListener) {
283
-    window.addEventListener('message', PreziPlayer.messageReceived, false);
284
-} else {
285
-    window.attachEvent('onmessage', PreziPlayer.messageReceived);
286
-}
287
-
288
-window.PreziPlayer = PreziPlayer;
289
-
290
-export default PreziPlayer;

+ 0
- 14
modules/UI/toolbars/Toolbar.js 查看文件

122
         AnalyticsAdapter.sendEvent('toolbar.chat.toggled');
122
         AnalyticsAdapter.sendEvent('toolbar.chat.toggled');
123
         emitter.emit(UIEvents.TOGGLE_CHAT);
123
         emitter.emit(UIEvents.TOGGLE_CHAT);
124
     },
124
     },
125
-    "toolbar_button_prezi": function () {
126
-        AnalyticsAdapter.sendEvent('toolbar.prezi.clicked');
127
-        emitter.emit(UIEvents.PREZI_CLICKED);
128
-    },
129
     "toolbar_button_etherpad": function () {
125
     "toolbar_button_etherpad": function () {
130
         AnalyticsAdapter.sendEvent('toolbar.etherpad.clicked');
126
         AnalyticsAdapter.sendEvent('toolbar.etherpad.clicked');
131
         emitter.emit(UIEvents.ETHERPAD_CLICKED);
127
         emitter.emit(UIEvents.ETHERPAD_CLICKED);
188
     'security':   '#toolbar_button_security',
184
     'security':   '#toolbar_button_security',
189
     'invite':     '#toolbar_button_link',
185
     'invite':     '#toolbar_button_link',
190
     'chat':       '#toolbar_button_chat',
186
     'chat':       '#toolbar_button_chat',
191
-    'prezi':      '#toolbar_button_prezi',
192
     'etherpad':   '#toolbar_button_etherpad',
187
     'etherpad':   '#toolbar_button_etherpad',
193
     'fullscreen': '#toolbar_button_fullScreen',
188
     'fullscreen': '#toolbar_button_fullScreen',
194
     'settings':   '#toolbar_button_settings',
189
     'settings':   '#toolbar_button_settings',
246
         }
241
         }
247
     },
242
     },
248
 
243
 
249
-    /**
250
-     * Disables and enables some of the buttons.
251
-     */
252
-    setupButtonsFromConfig () {
253
-        if (!UIUtil.isButtonEnabled('prezi')) {
254
-            $("#toolbar_button_prezi").css({display: "none"});
255
-        }
256
-    },
257
-
258
     /**
244
     /**
259
      * Unlocks the lock button state.
245
      * Unlocks the lock button state.
260
      */
246
      */

+ 1
- 3
modules/UI/util/UIUtil.js 查看文件

124
 
124
 
125
     isButtonEnabled: function (name) {
125
     isButtonEnabled: function (name) {
126
         var isEnabled = interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
126
         var isEnabled = interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
127
-        if (name === 'prezi') {
128
-            return isEnabled && !config.disablePrezi;
129
-        } else if (name === 'recording') {
127
+        if (name === 'recording') {
130
             return isEnabled && config.enableRecording;
128
             return isEnabled && config.enableRecording;
131
         }
129
         }
132
         return isEnabled;
130
         return isEnabled;

+ 2
- 8
modules/UI/videolayout/VideoLayout.js 查看文件

10
 
10
 
11
 import RemoteVideo from "./RemoteVideo";
11
 import RemoteVideo from "./RemoteVideo";
12
 import LargeVideoManager, {VideoContainerType} from "./LargeVideo";
12
 import LargeVideoManager, {VideoContainerType} from "./LargeVideo";
13
-import {PreziContainerType} from '../prezi/Prezi';
14
 import LocalVideo from "./LocalVideo";
13
 import LocalVideo from "./LocalVideo";
15
 import PanelToggler from "../side_pannels/SidePanelToggler";
14
 import PanelToggler from "../side_pannels/SidePanelToggler";
16
 
15
 
361
             false, false, false, function() {$(videoelem).show();});
360
             false, false, false, function() {$(videoelem).show();});
362
 
361
 
363
         // Update the large video to the last added video only if there's no
362
         // Update the large video to the last added video only if there's no
364
-        // current dominant, focused speaker or prezi playing or update it to
363
+        // current dominant, focused speaker or update it to
365
         // the current dominant speaker.
364
         // the current dominant speaker.
366
         if ((!focusedVideoResourceJid &&
365
         if ((!focusedVideoResourceJid &&
367
-            !currentDominantSpeaker &&
368
-             !this.isLargeContainerTypeVisible(PreziContainerType)) ||
366
+            !currentDominantSpeaker) ||
369
             focusedVideoResourceJid === resourceJid ||
367
             focusedVideoResourceJid === resourceJid ||
370
             (resourceJid &&
368
             (resourceJid &&
371
                 currentDominantSpeaker === resourceJid)) {
369
                 currentDominantSpeaker === resourceJid)) {
793
         }
791
         }
794
     },
792
     },
795
 
793
 
796
-    addRemoteVideoContainer (id) {
797
-        return RemoteVideo.createContainer(id);
798
-    },
799
-
800
     /**
794
     /**
801
      * Resizes the video area.
795
      * Resizes the video area.
802
      *
796
      *

+ 0
- 4
service/UI/UIEvents.js 查看文件

20
     START_MUTED_CHANGED: "UI.start_muted_changed",
20
     START_MUTED_CHANGED: "UI.start_muted_changed",
21
     AUDIO_MUTED: "UI.audio_muted",
21
     AUDIO_MUTED: "UI.audio_muted",
22
     VIDEO_MUTED: "UI.video_muted",
22
     VIDEO_MUTED: "UI.video_muted",
23
-    PREZI_CLICKED: "UI.prezi_clicked",
24
-    SHARE_PREZI: "UI.share_prezi",
25
-    PREZI_SLIDE_CHANGED: "UI.prezi_slide_changed",
26
-    STOP_SHARING_PREZI: "UI.stop_sharing_prezi",
27
     ETHERPAD_CLICKED: "UI.etherpad_clicked",
23
     ETHERPAD_CLICKED: "UI.etherpad_clicked",
28
     ROOM_LOCK_CLICKED: "UI.room_lock_clicked",
24
     ROOM_LOCK_CLICKED: "UI.room_lock_clicked",
29
     USER_INVITED: "UI.user_invited",
25
     USER_INVITED: "UI.user_invited",

Loading…
取消
儲存