@live-change/peer-connection-frontend 0.8.106 → 0.8.108

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.
@@ -311,6 +311,7 @@
311
311
 
312
312
  function setUserMedia(media) {
313
313
  if(media === model.value.media) return
314
+ if(media?.id === model.value.media?.id) return
314
315
  console.log("MEDIA STREAM CHANGE", media, 'FROM', model.value.media)
315
316
  if(model.value.media) {
316
317
  stopMedia(model.value.media)
@@ -343,12 +344,11 @@
343
344
  const limitedMedia = ref(null)
344
345
 
345
346
  const selectedConstraints = ref({ video: false, audio: false })
346
- watch(() => ({
347
- video: limitedMedia.value === 'audio' ? false :
348
- { deviceId: model.value?.videoInput?.deviceId, ...constraints.value.video },
349
- audio: limitedMedia.value === 'video' ? false :
347
+ watchEffect(() => {
348
+ const video = limitedMedia.value === 'audio' ? false :
349
+ { deviceId: model.value?.videoInput?.deviceId, ...constraints.value.video }
350
+ const audio = limitedMedia.value === 'video' ? false :
350
351
  { deviceId: model.value?.audioInput?.deviceId, ...constraints.value.audio }
351
- }), ({ video, audio }) => {
352
352
  console.log("SELECTED CONSTRAINTS", {
353
353
  video: selectedConstraints.value.video?.deviceId,
354
354
  audio: selectedConstraints.value.audio?.deviceId
@@ -358,7 +358,7 @@
358
358
  console.log("SELECTED CONSTRAINTS CHANGE", { video: video.deviceId, audio: audio.deviceId })
359
359
  selectedConstraints.value = { video, audio }
360
360
  }
361
- }, { immediate: true })
361
+ })
362
362
 
363
363
  const gettingUserMedia = ref(false)
364
364
  async function updateUserMedia(retry = false) {
@@ -386,6 +386,9 @@
386
386
  const mediaStream = await getUserMediaNative(constraints)
387
387
  if(JSON.stringify(selectedConstraints.value) !== JSON.stringify(constraints)) {
388
388
  console.log("SELECTED CONSTRAINTS CHANGED WHILE GETTING USER MEDIA")
389
+ stopMedia(mediaStream)
390
+ gettingUserMedia.value = false
391
+ setTimeout(() => updateUserMedia(), 10)
389
392
  return
390
393
  }
391
394
  /* if(userMedia.value && retry) {
@@ -47,10 +47,15 @@ async function isUserMediaPermitted(constraints = { audio: true, video: true })
47
47
  const getUserMediaNative = userMediaFactory()
48
48
  const getDisplayMediaNative = displayMediaFactory()
49
49
 
50
- const trackedStreams = []
50
+ //const trackedStreams = []
51
+ globalThis.trackedStreams = []
51
52
 
52
53
  async function getUserMedia(...args) {
53
54
  const stream = await getUserMediaNative(...args)
55
+ const index = trackedStreams.indexOf(stream)
56
+ if(index >= 0) {
57
+ console.error("STREAM ALREADY TRACKED", stream, "ALL STREAMS", trackedStreams)
58
+ }
54
59
  trackedStreams.push(stream)
55
60
  console.log("STREAM ADDED", stream, "ALL STREAMS", trackedStreams.length)
56
61
  return stream
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/peer-connection-frontend",
3
- "version": "0.8.106",
3
+ "version": "0.8.108",
4
4
  "scripts": {
5
5
  "memDev": "dotenvx run -- node server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "rm tmp.db; dotenvx run -- node server/start.js localDev --enableSessions --initScript ./init.js",
@@ -22,19 +22,19 @@
22
22
  },
23
23
  "type": "module",
24
24
  "dependencies": {
25
- "@live-change/cli": "^0.8.106",
26
- "@live-change/dao": "^0.8.106",
27
- "@live-change/dao-vue3": "^0.8.106",
28
- "@live-change/dao-websocket": "^0.8.106",
29
- "@live-change/framework": "^0.8.106",
30
- "@live-change/password-authentication-service": "^0.8.106",
31
- "@live-change/secret-code-service": "^0.8.106",
32
- "@live-change/secret-link-service": "^0.8.106",
33
- "@live-change/session-service": "^0.8.106",
34
- "@live-change/user-frontend": "^0.8.106",
35
- "@live-change/user-service": "^0.8.106",
36
- "@live-change/vue3-components": "^0.8.106",
37
- "@live-change/vue3-ssr": "^0.8.106",
25
+ "@live-change/cli": "^0.8.108",
26
+ "@live-change/dao": "^0.8.108",
27
+ "@live-change/dao-vue3": "^0.8.108",
28
+ "@live-change/dao-websocket": "^0.8.108",
29
+ "@live-change/framework": "^0.8.108",
30
+ "@live-change/password-authentication-service": "^0.8.108",
31
+ "@live-change/secret-code-service": "^0.8.108",
32
+ "@live-change/secret-link-service": "^0.8.108",
33
+ "@live-change/session-service": "^0.8.108",
34
+ "@live-change/user-frontend": "^0.8.108",
35
+ "@live-change/user-service": "^0.8.108",
36
+ "@live-change/vue3-components": "^0.8.108",
37
+ "@live-change/vue3-ssr": "^0.8.108",
38
38
  "@vueuse/core": "^10.11.0",
39
39
  "boxicons": "^2.1.4",
40
40
  "codeceptjs-assert": "^0.0.5",
@@ -54,7 +54,7 @@
54
54
  "vue3-scroll-border": "0.1.6"
55
55
  },
56
56
  "devDependencies": {
57
- "@live-change/codeceptjs-helper": "^0.8.106",
57
+ "@live-change/codeceptjs-helper": "^0.8.108",
58
58
  "codeceptjs": "^3.6.5",
59
59
  "generate-password": "1.7.1",
60
60
  "playwright": "^1.41.2",
@@ -65,5 +65,5 @@
65
65
  "author": "Michał Łaszczewski <michal@laszczewski.pl>",
66
66
  "license": "BSD-3-Clause",
67
67
  "description": "",
68
- "gitHead": "cd0102a76312f65e91a6cd70fab3e0a4ff961345"
68
+ "gitHead": "b272a01967e326d10874fea13353ab8fa5c30fe8"
69
69
  }