@reactoo/watchtogether-sdk-js 2.5.22 → 2.5.23
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
|
@@ -228,7 +228,7 @@ const syncHlsJs = function ({room, wt, roomSession, emitter} = {}) {
|
|
|
228
228
|
if(!currentFragment) {
|
|
229
229
|
return 0;
|
|
230
230
|
}
|
|
231
|
-
return Math.max((_libraryInstance.streamController.lastCurrentTime - currentFragment.body
|
|
231
|
+
return Math.max((_libraryInstance.streamController.lastCurrentTime - (currentFragment.body?.startPTS || 0)) * 1000, 0)
|
|
232
232
|
};
|
|
233
233
|
|
|
234
234
|
const calculateSyncDifferenceTime = (masterFragmentSn, masterFragmentPos, ping) => {
|
|
@@ -245,7 +245,7 @@ const syncHlsJs = function ({room, wt, roomSession, emitter} = {}) {
|
|
|
245
245
|
return {position: null, isBufferSufficient: false}
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
let currentFragmentPos = Math.max((_libraryInstance.streamController.lastCurrentTime - currentFragment.body
|
|
248
|
+
let currentFragmentPos = Math.max((_libraryInstance.streamController.lastCurrentTime - (currentFragment.body?.startPTS || 0)) * 1000, 0);
|
|
249
249
|
let currentFragmentLength = currentFragment.body.duration * 1000;
|
|
250
250
|
|
|
251
251
|
room._log(`Our current fragment is: ${currentFragmentSn}`);
|
package/src/modules/wt-room.js
CHANGED
|
@@ -673,9 +673,9 @@ class RoomSession {
|
|
|
673
673
|
config.dataChannelOpen = this.defaultDataChannelLabel === data?.label && data?.state === 'open';
|
|
674
674
|
}
|
|
675
675
|
|
|
676
|
-
if (handleId === this.handleId) {
|
|
677
|
-
this._isDataChannelOpen =
|
|
678
|
-
this.emit('dataChannel',
|
|
676
|
+
if (handleId === this.handleId && this.defaultDataChannelLabel === data?.label) {
|
|
677
|
+
this._isDataChannelOpen = data?.state === 'open';
|
|
678
|
+
this.emit('dataChannel', data?.state === 'open');
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
681
|
|