|
@@ -44,7 +44,8 @@ export default class SharedVideoManager {
|
44
|
44
|
|
45
|
45
|
if(APP.conference.isLocalId(this.from)) {
|
46
|
46
|
showStopVideoPropmpt().then(() =>
|
47
|
|
- this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop'));
|
|
47
|
+ this.emitter.emit(
|
|
48
|
+ UIEvents.UPDATE_SHARED_VIDEO, this.url, 'stop'));
|
48
|
49
|
} else {
|
49
|
50
|
messageHandler.openMessageDialog(
|
50
|
51
|
"dialog.shareVideoTitle",
|
|
@@ -84,7 +85,7 @@ export default class SharedVideoManager {
|
84
|
85
|
// we need to operate with player after start playing
|
85
|
86
|
// self.player will be defined once it start playing
|
86
|
87
|
// and will process any initial attributes if any
|
87
|
|
- this.initialAttributes = null;
|
|
88
|
+ this.initialAttributes = attributes;
|
88
|
89
|
|
89
|
90
|
var self = this;
|
90
|
91
|
if(self.isPlayerAPILoaded)
|
|
@@ -157,13 +158,6 @@ export default class SharedVideoManager {
|
157
|
158
|
self.updateCheck.bind(self),
|
158
|
159
|
updateInterval);
|
159
|
160
|
}
|
160
|
|
-
|
161
|
|
- if(self.player)
|
162
|
|
- self.processAttributes(
|
163
|
|
- self.player, attributes, self.playerPaused);
|
164
|
|
- else {
|
165
|
|
- self.initialAttributes = attributes;
|
166
|
|
- }
|
167
|
161
|
};
|
168
|
162
|
|
169
|
163
|
window.onPlayerError = function(event) {
|
|
@@ -201,6 +195,8 @@ export default class SharedVideoManager {
|
201
|
195
|
player.pauseVideo();
|
202
|
196
|
|
203
|
197
|
this.processTime(player, attributes, !playerPaused);
|
|
198
|
+ } else if (attributes.state == 'stop') {
|
|
199
|
+ this.stopSharedVideo(this.from);
|
204
|
200
|
}
|
205
|
201
|
}
|
206
|
202
|
|
|
@@ -236,8 +232,10 @@ export default class SharedVideoManager {
|
236
|
232
|
updateCheck(sendPauseEvent)
|
237
|
233
|
{
|
238
|
234
|
// ignore update checks if we are not the owner of the video
|
239
|
|
- // or there is still no player defined
|
240
|
|
- if(!APP.conference.isLocalId(this.from) || !this.player)
|
|
235
|
+ // or there is still no player defined or we are stopped
|
|
236
|
+ // (in a process of stopping)
|
|
237
|
+ if(!APP.conference.isLocalId(this.from) || !this.player
|
|
238
|
+ || !this.isSharedVideoShown)
|
241
|
239
|
return;
|
242
|
240
|
|
243
|
241
|
let state = this.player.getPlayerState();
|
|
@@ -287,13 +285,18 @@ export default class SharedVideoManager {
|
287
|
285
|
* left and we want to remove video if the user sharing it left).
|
288
|
286
|
* @param id the id of the sender of the command
|
289
|
287
|
*/
|
290
|
|
- stopSharedVideo (id) {
|
|
288
|
+ stopSharedVideo (id, attributes) {
|
291
|
289
|
if (!this.isSharedVideoShown)
|
292
|
290
|
return;
|
293
|
291
|
|
294
|
292
|
if(this.from !== id)
|
295
|
293
|
return;
|
296
|
294
|
|
|
295
|
+ if(!this.player){
|
|
296
|
+ this.initialAttributes = attributes;
|
|
297
|
+ return;
|
|
298
|
+ }
|
|
299
|
+
|
297
|
300
|
if(this.intervalId) {
|
298
|
301
|
clearInterval(this.intervalId);
|
299
|
302
|
this.intervalId = null;
|