Re: Can getUserMedia() get called on a callback/event ?

2015-04-14 3:52 GMT+02:00 Justin Uberti <juberti@google.com>:
> Inaki, do you have a JSFiddle demonstrating the problem? It's not clear to
> me what exactly in your app Chrome is not happy about.

Justin, I'm getting crazy. Now it works in every case, in Chrome 42,
Canary and Firefox:

http://jsfiddle.net/ibcaliax/Lcmy7r1t/

Note that there I do:

- On DOM ready run a 1s timer.
- On timeout run a WebSocket that produces a connection error.
- On ws error run another 1s timer.
- On timeout create a PC and run setRemoteDescription() with a wrong
description.
- On failure callback run another 1s timer.
- On timeout callback run getUserMedia().
- ...and getUserMedia() works (prompt shown).


I'm pretty sure the behavior has changed somehow since the same did
not work in Chrome when I opened this issue (in fact check my first
mail with a similar usecase in which gUM was called in the
ws.onmessage:


ws.onmessage = function (event) {
  var sdp = event.data;

// First try to set it as remote description
pc.setRemoteDescription(
      new RTCSessionDescription({type:'offer', sdp:sdp}),
      // If valid, prompt the user for audio/video.
      getUserMedia({video:true}, onSuccess, onFailure),
      // failure
      function(error) {
          console.error(error);
      }
);


That did not work 4 month ago...


-- 
Iñaki Baz Castillo
<ibc@aliax.net>

Received on Friday, 17 April 2015 09:47:54 UTC