@reactoo/watchtogether-sdk-js 2.5.69 → 2.5.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -46,44 +46,49 @@ const syncModule = function ({room, emitter} = {}) {
|
|
|
46
46
|
room._log('--- Sync enabled ---');
|
|
47
47
|
|
|
48
48
|
stopFlag = false;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
|
|
50
|
+
if(!_playerInterfaceOptions.type === 'push') {
|
|
51
|
+
const loop = () => {
|
|
52
|
+
|
|
53
|
+
isSyncing = true;
|
|
54
|
+
emitter.emit('playerSyncing', true);
|
|
55
|
+
|
|
56
|
+
sync().finally(() => {
|
|
57
|
+
|
|
58
|
+
isSyncing = false;
|
|
59
|
+
emitter.emit('playerSyncing', false);
|
|
60
|
+
|
|
61
|
+
if(isConnected() && !stopFlag) {
|
|
62
|
+
syncWaitId = setTimeout(loop, syncNextWaitTime);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
room._log('--- Automatic stop due to user not connected or stop flag enabled ---');
|
|
66
|
+
stopSyncLoop();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
})
|
|
70
|
+
};
|
|
71
|
+
loop();
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const loop2 = () => {
|
|
75
|
+
seekForward()
|
|
76
|
+
.then(() => {
|
|
77
|
+
setNextWaitTime(false);
|
|
78
|
+
})
|
|
79
|
+
.catch((e) => {
|
|
80
|
+
setNextWaitTime(true);
|
|
81
|
+
console.log('Sync failed', e);
|
|
82
|
+
});
|
|
83
|
+
syncWaitId = setTimeout(loop2, syncNextWaitTime);
|
|
84
|
+
};
|
|
85
|
+
loop2();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
72
89
|
|
|
73
90
|
//TODO: push sync
|
|
74
|
-
|
|
75
|
-
// seekForward()
|
|
76
|
-
// .then(() => {
|
|
77
|
-
// setNextWaitTime(false);
|
|
78
|
-
// })
|
|
79
|
-
// .catch((e) => {
|
|
80
|
-
// setNextWaitTime(true);
|
|
81
|
-
// console.log('Sync failed', e);
|
|
82
|
-
// });
|
|
83
|
-
// syncWaitId = setTimeout(loop2, syncNextWaitTime);
|
|
84
|
-
// };
|
|
85
|
-
//
|
|
86
|
-
// loop2();
|
|
91
|
+
|
|
87
92
|
|
|
88
93
|
};
|
|
89
94
|
|
|
@@ -582,10 +587,10 @@ const syncModule = function ({room, emitter} = {}) {
|
|
|
582
587
|
return;
|
|
583
588
|
}
|
|
584
589
|
|
|
585
|
-
if(_playerInterfaceOptions.type === 'push') {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}
|
|
590
|
+
// if(_playerInterfaceOptions.type === 'push') {
|
|
591
|
+
// room._log('Push sync is not implemented in this sync module yet');
|
|
592
|
+
// return;
|
|
593
|
+
// }
|
|
589
594
|
|
|
590
595
|
if(_playerInterface.isVod) {
|
|
591
596
|
room._log('VOD sync is not implemented in this sync module yet');
|