electron / electron/remote

Sharing a MediaStreamTrack via getGlobal not working

Open
#183 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
411
Forks
53
Avg merge
3m
Merged PRs (30d)
1

Description

we try to share a MediaStreamTrack across windows using remote.getGlobal

`remote.getGlobal('shared').videoStream = desktopstream.getVideoTracks()[0];`

in main.js its also still recognized as a MediaStreamTrack
but when we get it in the 2nd window via

`let videoTrack = remote.getGlobal('shared').videoStream;`
it is a simple object only and no longer a MediaStreamTrack

in 1st windows console we get

```
callbacks-registry.js:54 Uncaught TypeError: Illegal invocation
at CallbacksRegistry.apply (callbacks-registry.js:54:1)
at remote.js:353:1
at EventEmitter. (remote.js:335:1)
at EventEmitter.emit (node:events:513:28)
at Object.onMessage (node:electron/js2c/renderer_init:2:9240)
```

as soon as we get the track in 2nd window

isn't it possible to share the MEdiaStreamTrack via remote.getGlobal?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.