@reactoo/watchtogether-sdk-js 2.5.20 → 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/example/index.html
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
<script>
|
|
26
26
|
|
|
27
|
-
let roomId = '
|
|
27
|
+
let roomId = 'adab485a-548e-44a8-a9ca-157f3ba50c6e'; //It will create room automatically if not set
|
|
28
28
|
let pinHash = undefined;//'967ca05f-7fab-a205-5913-39393bbbe923';
|
|
29
29
|
|
|
30
30
|
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
.then(r => {
|
|
125
125
|
|
|
126
126
|
if(roomId) {
|
|
127
|
+
console.log(roomId);
|
|
127
128
|
return Promise.resolve({roomId, pinHash});
|
|
128
129
|
}
|
|
129
130
|
|
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}`);
|