*Elemental2 (not Element2 🙂). Ie: https://github.com/google/elemental2
On Tuesday, 15 July 2025 at 3:55:58 pm UTC+10 Craig Mitchell wrote:
> 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/fe0495c3-37ee-4c6b-a125-6e208a287890n%40googlegroups.com.