W3C home > Mailing lists > Public > public-webrtc@w3.org > February 2013

Re: [discuss-webrtc] PeerConnection on WebWorker

From: Justin Uberti <juberti@google.com>
Date: Sat, 23 Feb 2013 20:55:54 -0800
Message-ID: <CAOJ7v-1EXonSasjz_Y9kggm-zc1cCCXnE45Vj7nGx1kiodW+nQ@mail.gmail.com>
To: discuss-webrtc <discuss-webrtc@googlegroups.com>
Cc: public-webrtc <public-webrtc@w3.org>
Web Workers can't manipulate the DOM, including PeerConnection.

See https://developer.mozilla.org/en-US/docs/DOM/Using_web_workers.


On Sat, Feb 23, 2013 at 5:49 PM, piranna@gmail.com <piranna@gmail.com>wrote:

> I've got this issue on Chrome v24 and v26, but I think it's related
> with the specificacion since I didn't see anything about it there.
>
> I'm trying to create a PeerConnection (to later create a DataChannel
> from it) from inside a WebWorker, with the idea of use in the future a
> SharedWorker. My intention is to move all the logic of my application
> (a P2P filesharing application) to a SharedWorker and leave only on
> the window thread the UI related code, so it can be accessed from
> several browser tabs at a time, and also have the option to easily use
> a WebSocket to a remote server running the logic of the application
> instead against the local WebWorker/SharedWorker (the API is almost
> the same, only one using send() method and the other usind
> postMessage() method. I truly don't know why that difference between
> both, but this a different story...). The problem is that trying to
> create the PeerConnection inside the WebWorker it tell me that both
> webkitRTCPeerConnection and RTCPeerConnection are not defined, so I
> suppose this use case was not considered by the specification.
>
> A temporal solution would be that the WebWorker send back the
> petitions to use the PeerConnection object to the window thread and
> process them there, but this would over complicate the application
> architecture and also decrease performance.
>
> Any clue about this topic?
>
>
> --
> "Si quieres viajar alrededor del mundo y ser invitado a hablar en un
> monton de sitios diferentes, simplemente escribe un sistema operativo
> Unix."
> – Linus Tordvals, creador del sistema operativo Linux
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "discuss-webrtc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to discuss-webrtc+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
Received on Sunday, 24 February 2013 04:56:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:32 UTC