I'm trying to use Element2 to create a WebRTC connection.

In the elemental2.dom.RTCPeerConnection class, there are a bunch 
of createOffer and createAnswer methods that all 
return Promise<RTCSessionDescription>.

If I try to use them, I get a ClassCastException.  This is because GWT is 
trying to create the RTCSessionDescription from the JS object, and it can't.

I believe all these createOffer and createAnswer methods should be 
returning Promise<RTCSessionDescriptionInit> instead.

For reference, this is the Element2 RTCSessionDescription:
package elemental2.dom;

import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;

@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public class RTCSessionDescription {
  public String sdp;
  public String type;
  public RTCSessionDescription() {}
  public RTCSessionDescription(RTCSessionDescriptionInit descriptionInitDict) 
{}
}

And this is the Element2 RTCSessionDescriptionInit:
package elemental2.dom;

import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import jsinterop.base.Js;
import jsinterop.base.JsPropertyMap;

@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public interface RTCSessionDescriptionInit {
  @JsOverlay
  static RTCSessionDescriptionInit create() {
    return Js.uncheckedCast(JsPropertyMap.of());
  }

  @JsProperty
  String getSdp();

  @JsProperty
  String getType();

  @JsProperty
  void setSdp(String sdp);

  @JsProperty
  void setType(String type);
}

Is it somehow possible to fix up Elemental2 createOffer and createAnswer 
methods?

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/google-web-toolkit/fdf896e9-4dcb-4b82-9e6c-f328a9a0b5b2n%40googlegroups.com.

Reply via email to