{"action":"created","comment":{"url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/comments/50382773","id":50382773,"diff_hunk":"@@ -0,0 +1,862 @@\n+/**\n+ * http://www.w3.org/TR/2015/WD-webrtc-20150210/\n+ */\n+package org.scalajs.dom.experimental.webrtc\n+\n+import org.scalajs.dom.raw.{Promise, DOMError, Event, EventTarget}\n+import scala.scalajs.js\n+import org.scalajs.dom.experimental.mediastream._\n+import scala.scalajs.js.annotation.JSName\n+import scala.scalajs.js.|\n+\n+@js.native\n+trait RTCIdentityAssertion extends js.Object {\n+  val idp: String = js.native\n+  val name :String = js.native\n+}\n+\n+object RTCIdentityAssertion {\n+  def apply(\n+      idp: js.UndefOr[String] = js.undefined,\n+      name: js.UndefOr[String] = js.undefined): RTCIdentityAssertion = {\n+    val result = js.Dynamic.literal()\n+    idp.foreach(result.idp = _)\n+    name.foreach(result.name = _)\n+    result.asInstanceOf[RTCIdentityAssertion]\n+  }\n+}\n+\n+@js.native\n+trait RTCOfferOptions  extends js.Object {\n+\n+  /**\n+   * When the value of this dictionary member is true, the generated\n+   * description will have ICE credentials that are different from the current\n+   * credentials (as visible in the localDescription attribute's SDP). Applying\n+   * the generated description will restart ICE.\n+   *\n+   * When the value of this dictionary member is false, and the localDescription\n+   * attribute has valid ICE credentials, the generated description will have\n+   * the same ICE credentials as the current value from the localDescription\n+   * attribute.\n+   *\n+   */\n+  var iceRestart: Boolean = js.native\n+\n+  /**\n+   * In some cases, an RTCPeerConnection may wish to receive audio but not send\n+   * any audio. The RTCPeerConnection needs to know if it should signal to the\n+   * remote side whether it wishes to receive audio. This option allows an\n+   * application to indicate its preferences for the number of audio streams\n+   * to receive when creating an offer.\n+   *\n+   */\n+  var offerToReceiveAudio: Long = js.native\n+\n+  /**\n+   * In some cases, an RTCPeerConnection may wish to receive video but not send\n+   * any video. The RTCPeerConnection needs to know if it should signal to the\n+   * remote side whether it wishes to receive video or not. This option allows\n+   * an application to indicate its preferences for the number of video streams\n+   * to receive when creating an offer.\n+   *\n+   */\n+  var offerToReceiveVideo: Long = js.native\n+\n+  /**\n+   * default: true\n+   * Many codecs and system are capable of detecting \"silence\" and changing\n+   * their behavior in this case by doing things such as not transmitting any\n+   * media. In many cases, such as when dealing with emergency calling or\n+   * sounds other than spoken voice, it is desirable to be able to turn off\n+   * this behavior. This option allows the application to provide information\n+   * about whether it wishes this type of processing enabled or disabled.\n+   *\n+   */\n+  var voiceActivityDetection: Boolean = js.native\n+}\n+\n+object RTCOfferOptions  {\n+  def apply(\n+      iceRestart: js.UndefOr[Boolean] = js.undefined,\n+      offerToReceiveAudio: js.UndefOr[Long] = js.undefined,\n+      offerToReceiveVideo: js.UndefOr[Long] = js.undefined,\n+      voiceActivityDetection: js.UndefOr[Boolean] = js.undefined): RTCOfferOptions  = {\n+    val result = js.Dynamic.literal()\n+    iceRestart.foreach(result.iceRestart = _)\n+    offerToReceiveAudio.foreach(result.offerToReceiveAudio = _)\n+    offerToReceiveVideo.foreach(result.offerToReceiveVideo = _)\n+    voiceActivityDetection.foreach(result.voiceActivityDetection = _)\n+    result.asInstanceOf[RTCOfferOptions ]\n+  }\n+}\n+\n+@js.native\n+trait RTCIceServer extends js.Object {\n+  var urls: String | js.Array[String] = js.native\n+  var username: String  = js.native\n+  var credential: String  = js.native\n+}\n+\n+object RTCIceServer {\n+  def apply(\n+      urls: js.UndefOr[String | js.Array[String]] = js.undefined,\n+      username: js.UndefOr[String] = js.undefined,\n+      credential: js.UndefOr[String] = js.undefined): RTCIceServer = {\n+    val result = js.Dynamic.literal()\n+    urls.foreach(v => result.urls = v.asInstanceOf[js.Any])\n+    username.foreach(result.username = _)\n+    credential.foreach(result.credential = _)\n+    result.asInstanceOf[RTCIceServer]\n+  }\n+}\n+\n+\n+\n+@js.native\n+trait RTCConfiguration extends js.Object {\n+\n+  /**\n+   * An array containing URIs of servers available to be used by ICE, such\n+   * as STUN and TURN server.\n+   *\n+   */\n+  var iceServers: js.Array[RTCIceServer] = js.native\n+\n+  /**\n+   * defaulting to \"all\"\n+   * Indicates which candidates the ICE engine is allowed to use.\n+   *\n+   */\n+  var iceTransportPolicy: String = js.native\n+\n+  /**\n+   * defaulting to \"balanced\"\n+   * Indicates which BundlePolicy to use.\n+   *\n+   */\n+  var bundlePolicy: String = js.native\n+\n+  /**\n+   * Sets the target peer identity for the RTCPeerConnection. The\n+   * RTCPeerConnection will establish a connection to a remote peer unless\n+   * it can be successfully authenticated with the provided name.\n+   *\n+   */\n+  var peerIdentity: String = js.native\n+}\n+\n+object RTCConfiguration {\n+  object RTCIceTransportPolicy {\n+    val none = \"none\"\n+    val relay = \"relay\"\n+    val all = \"all\"\n+  }\n+\n+  object RTCBundlePolicy {\n+    val balanced = \"balanced\"\n+    val `max-compat` = \"max-compat\"\n+    val `max-bundle` = \"max-bundle\"\n+  }\n+\n+  def apply(\n+      iceServers: js.UndefOr[js.Array[RTCIceServer]] = js.undefined,\n+      iceTransportPolicy: js.UndefOr[String] = js.undefined,\n+      bundlePolicy: js.UndefOr[String] = js.undefined,\n+      peerIdentity: js.UndefOr[String] = js.undefined): RTCConfiguration = {\n+    val result = js.Dynamic.literal()\n+    iceServers.foreach(result.iceServers = _)\n+    iceTransportPolicy.foreach(result.iceTransportPolicy = _)\n+    bundlePolicy.foreach(result.bundlePolicy = _)\n+    peerIdentity.foreach(result.peerIdentity = _)\n+    result.asInstanceOf[RTCConfiguration]\n+  }\n+}\n+\n+@JSName(\"RTCSessionDescription\")\n+@js.native\n+class RTCSessionDescription(options: js.Dynamic) extends js.Object {\n+\n+  /**\n+   * This constructor returns a new RTCSessionDescription. The parameter is a\n+   * RTCSessionDescriptionInit dictionary containing the (optional) values\n+   * for the two properties. Any values not specified in the dictionary will\n+   * be initialized to null.\n+   *\n+   * MDN\n+   */\n+  //def this(options: js.Dynamic) = this(options)\n+\n+  /**\n+   * An enum of type RTCSdpType describing the session description's type.\n+   *\n+   * MDN\n+   */\n+  var `type`: String = js.native\n+\n+  /**\n+   * A DOMString containing the SDP format describing the session.\n+   *\n+   * MDN\n+   */\n+  var sdp: String = js.native\n+\n+  /**\n+   * Returns a JSON description of the object. The values of both properties,\n+   * type and {domxref(\"RTCSessionDescription.sdp\", \"sdp\")}}, are contained\n+   * in the generated JSON.\n+   *\n+   * MDN\n+   */\n+  def toJson(): js.Any = js.native\n+}\n+\n+object RTCSessionDescription {\n+  def apply(\n+      `type`: js.UndefOr[String] = js.undefined,\n+      sdp: js.UndefOr[String] = js.undefined): RTCSessionDescription = {\n+    val result = js.Dynamic.literal()\n+    `type`.foreach(result.`type` = _)\n+    sdp.foreach(result.sdp = _)\n+    new RTCSessionDescription(result)\n+  }\n+}\n+\n+object RTCSdpType {\n+  val offer = \"offer\"\n+  val pranswer = \"pranswer\"\n+  val answer = \"answer\"\n+  val rollback = \"rollback\"\n+}\n+\n+@JSName(\"RTCIceCandidate\")\n+@js.native\n+class RTCIceCandidate(builder: js.Dynamic) extends js.Object {\n+  var candidate: String = js.native\n+  var sdpMLineIndex: Int = js.native\n+  var sdpMid: String = js.native\n+}\n+\n+object RTCIceCandidate {\n+  def apply(\n+      candidate: js.UndefOr[String] = js.undefined,\n+      sdpMLineIndex: js.UndefOr[Int] = js.undefined,\n+      sdpMid: js.UndefOr[String] = js.undefined): RTCIceCandidate = {\n+    val result = js.Dynamic.literal()\n+    candidate.foreach(result.candidate = _)\n+    sdpMLineIndex.foreach(result.sdpMLineIndex = _)\n+    sdpMid.foreach(result.sdpMid = _)\n+    new RTCIceCandidate(result)\n+  }\n+}\n+\n+object MediaDevicesInfoKind {\n+  val videoinput = \"videoinput\"\n+  val audioinput = \"audioinput\"\n+  val audiooutput = \"audiooutput\"\n+}\n+\n+@js.native\n+trait MediaDevicesInfo extends js.Object {\n+\n+  /**\n+   * Returns a DOMString that is an identifier for the represented device\n+   * that is persisted across sessions. It is un-guessable by other\n+   * applications and unique to the origin of the calling application. It is\n+   * reset when the user clears cookies (for Private Browsing, a different\n+   * identifier is used that is not persisted across sessions).\n+   *\n+   * MDN\n+   */\n+  val deviceId: String = js.native\n+\n+  /**\n+   * Returns a DOMString that is a group identifier. Two devices have the same\n+   * group identifier if they belong to the same physical device; for example\n+   * a monitor with both a built-in camera and microphone.\n+   *\n+   * MDN\n+   */\n+  val groupId: String = js.native\n+\n+  /**\n+   * enum MediaDevicesInfoKind\n+   * Returns an enumerated value that is either \"videoinput\", \"audioinput\"\n+   * or \"audiooutput\".\n+   *\n+   * MDN\n+   */\n+  val kind: String = js.native\n+\n+  /**\n+   * Returns a DOMString that is a label describing this device (for example\n+   * \"External USB Webcam\"). Only available during active MediaStream use or\n+   * when persistent permissions have been granted.\n+   *\n+   * MDN\n+   */\n+  val label: String = js.native\n+}\n+\n+object MediaDevicesInfo {\n+  def apply(\n+      deviceId: js.UndefOr[String] = js.undefined,\n+      groupId: js.UndefOr[String] = js.undefined,\n+      kind: js.UndefOr[String] = js.undefined,\n+      label: js.UndefOr[String] = js.undefined): MediaDevicesInfo = {\n+    val result = js.Dynamic.literal()\n+    deviceId.foreach(result.deviceId = _)\n+    groupId.foreach(result.groupId = _)\n+    kind.foreach(result.kind = _)\n+    label.foreach(result.label = _)\n+    result.asInstanceOf[MediaDevicesInfo]\n+  }\n+}\n+\n+// TODO: ..\n+// https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel\n+trait RTCDataChannel {\n+  // TODO: ...\n+}\n+\n+//https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection\n+trait RTCDataChannelInit {\n+  // TODO: ..\n+}\n+\n+//https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection\n+trait RTCDTMFSender {\n+  // TODO: ..\n+}\n+\n+//https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection\n+trait RTCStatsReport {\n+  // TODO: ..\n+}\n+\n+@js.native\n+trait RTCPeerConnectionIceEvent extends Event {\n+  val candidate: RTCIceCandidate  = js.native\n+}\n+\n+object IceConnectionState {\n+  val `new` = \"new\"\n+  val checking = \"checking\"\n+  val connected = \"connected\"\n+  val completed = \"completed\"\n+  val failed = \"failed\"\n+  val disconnected = \"disconnected\"\n+  val closed = \"closed\"\n+}\n+\n+object SignalingState {\n+  val stable = \"stable\"\n+  val `have-local-offer` = \"have-local-offer\"\n+  val `have-local-pranswer` = \"have-local-pranswer\"\n+  val `have-remote-pranswer` = \"have-remote-pranswer\"\n+  val closed = \"closed\"\n+}\n+\n+/**\n+ * The MediaStream\n+ *\n+ * MDN\n+ *\n+ */\n+@js.native\n+class RTCPeerConnection(\n+    configuration: js.UndefOr[RTCConfiguration] = js.undefined) extends EventTarget {\n+  /**\n+   * READONLY Returns an enum of type RTCIceConnectionState that describes the\n+   * ICE connection state for the connection. When this value changes, a\n+   * iceconnectionstatechange event is fired on the object. The possible values\n+   * are:\n+   *    \"new\": the ICE agent is gathering addresses or waiting for remote\n+   *    candidates (or both).\n+   *\n+   *    \"checking\": the ICE agent has remote candidates, on at least one\n+   *    component, and is check them, though it has not found a connection yet.\n+   *    At the same time, it may still be gathering candidates.\n+   *\n+   *    \"connected\": the ICE agent has found a usable connection for each\n+   *    component, but is still testing more remote candidates for a better\n+   *    connection. At the same time, it may still be gathering candidates.\n+   *\n+   *    \"completed\": the ICE agent has found a usable connection for each\n+   *    component, and is no more testing remote candidates.\n+   *\n+   *    \"failed\": the ICE agent has checked all the remote candidates and\n+   *    didn't find a match for at least one component. Connections may have\n+   *    been found for some components.\n+   *\n+   *    \"disconnected\": liveness check has failed for at least one component.\n+   *    This may be a transient state, e. g. on a flaky network, that can\n+   *    recover by itself.\n+   *\n+   *    \"closed\": the ICE agent has shutdown and is not answering to requests.\n+   *\n+   * MDN\n+   */\n+  val iceConnectionState: String = js.native\n+\n+  /**\n+   * READONLY Returns an enum of type RTCIceGatheringState that describes the\n+   * ICE gathering state for the connection. The possible values are:\n+   *    \"new\": the object was just created, and no networking has occurred yet.\n+   *\n+   *    \"gathering\": the ICE engine is in the process of gathering candidates\n+   *    for this connection.\n+   *\n+   *    \"complete\": the ICE engine has completed gathering. Events such as\n+   *    adding a new interface or a new TURN server will cause the state to\n+   *    go back to gathering.\n+   *\n+   * MDN\n+   */\n+  val iceGatheringState: String = js.native\n+\n+  /**\n+   * This attribute indicates whether the remote peer is able to accept trickled\n+   * ICE candidates [TRICKLE-ICE]. The value is determined based on whether a\n+   * remote description indicates support for trickle ICE, as defined in Section\n+   * 4.1.9 of [RTCWEB-JSEP]. Prior to the completion of setRemoteDescription,\n+   * this value is null.\n+   */\n+  val canTrickleIceCandidates: js.Any = js.native\n+\n+  /**\n+   * READONLY Returns a RTCSessionDescription describing the session for the\n+   * local end of the connection. If it has not yet been set, it can be null.\n+   *\n+   * MDN\n+   */\n+  val localDescription: RTCSessionDescription = js.native\n+\n+  /**\n+   * Returns a RTCIdentityAssertion, that is a couple of a domain name (idp)\n+   * and a name (name) representing the identity of the remote peer of this\n+   * connection, once set and verified. If no peer has yet been set and\n+   * verified, this property will return null. Once set, via the appropriate\n+   * method, it can't be changed.\n+   *\n+   * MDN\n+   */\n+  val peerIdentity: RTCIdentityAssertion = js.native\n+\n+  /**\n+   * Returns a RTCSessionDescription describing the session for the remote end\n+   * of the connection. If it has not yet been set, it can be null.\n+   *\n+   * MDN\n+   */\n+  val remoteDescription: RTCSessionDescription = js.native\n+\n+  /**\n+   * READONLY Returns an enum of type RTCSignalingState that describes the\n+   * signaling state of the local connection. This state describes the SDP\n+   * offer, that defines the configuration of the connections like the\n+   * description of the locally associated objects of type MediaStream, the\n+   * codec/RTP/RTCP options, the candidates gathered by the ICE Agent. When\n+   * this value changes, a signalingstatechange event is fired on the object.\n+   * The possible values are:\n+   *\n+   *    \"stable\": there is no SDP offer/answer exchange in progress. This is\n+   *    also the initial state of the connection.\n+   *\n+   *    \"have-local-offer\": the local end of the connection has locally applied\n+   *    a SDP offer.\n+   *\n+   *    \"have-remote-offer\": the remote end of the connection has locally\n+   *    applied a SDP offer.\n+   *\n+   *    \"have-local-pranswer\": a remote SDP offer has been applied, and a SDP\n+   *    pranswer applied locally.\n+   *\n+   *    \"have-remote-pranswer\": a local SDP offer has been applied, and a SDP\n+   *    pranswer applied remotely.\n+   *\n+   *    \"closed\": the connection is closed.\n+   *\n+   * MDN\n+   */\n+  val signalingState: String = js.native\n+\n+  /**\n+   * Is the event handler called when the addstream event is received. Such an\n+   * event is sent when a MediaStream is added to this connection by the\n+   * remote peer. The event is sent immediately after the call\n+   * RTCPeerConnection.setRemoteDescription() and doesn't wait for the result\n+   * of the SDP negotiation.\n+   *\n+   * MDN\n+   */\n+  var onaddstream: js.Function1[MediaStreamEvent, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the datachannel event is received. Such\n+   * an event is sent when a RTCDataChannel is added to this connection.\n+   *\n+   * MDN\n+   */\n+  var ondatachannel: js.Function1[Event, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the icecandidate event is received. Such\n+   * an event is sent when a RTCICECandidate object is added to the script..\n+   *\n+   * MDN\n+   */\n+  var onicecandidate: js.Function1[RTCPeerConnectionIceEvent, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the iceconnectionstatechange event is\n+   * received. Such an event is sent when the value of iceConnectionState\n+   * changes.\n+   *\n+   * MDN\n+   */\n+  var oniceconnectionstatechange: js.Function1[Event, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the identityresult event is received.\n+   * Such an event is sent when an identity assertion is generated, via\n+   * getIdentityAssertion(), or during the creation of an offer or an answer.\n+   *\n+   * MDN\n+   */\n+  var onidentityresult: js.Function1[Event, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the idpassertionerror event is received.\n+   * Such an event is sent when the associated identity provider (IdP)\n+   * encounters an error while generating an identity assertion.\n+   *\n+   * MDN\n+   */\n+  var onidpassertionerror: js.Function1[Event, Any] = js.native\n+\n+  /**\n+   * Is the event handler alled when the idpvalidationerror event is received.\n+   * Such an event is sent when the associated identity provider (IdP)\n+   * encounters an error while validating an identity assertion.\n+   *\n+   * MDN\n+   */\n+  var onidpvalidationerror: js.Function1[Event, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the negotiationneeded event, sent by the\n+   * browser to inform that negotiation will be required at some point in the\n+   * future, is received.\n+   *\n+   * MDN\n+   */\n+  var onnegotiationneeded: js.Function1[Event, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the peeridentity event, sent when a peer\n+   * identity has been set and verified on this connection, is received.\n+   *\n+   * MDN\n+   */\n+  var onpeeridentity: js.Function1[Event, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the removestream event, sent when a\n+   * MediaStream is removed from this connection, is received.\n+   *\n+   * MDN\n+   */\n+  var onremovestream: js.Function1[MediaStreamEvent, Any] = js.native\n+\n+  /**\n+   * Is the event handler called when the signalingstatechange event, sent when\n+   * the value of signalingState changes, is received.\n+   *\n+   * MDN\n+   */\n+  var onsignalingstatechange: js.Function1[Event, Any] = js.native\n+\n+  /**\n+   * The createOffer method generates a blob of SDP that contains an RFC 3264\n+   * offer with the supported configurations for the session, including\n+   * descriptions of the local MediaStreams attached to this RTCPeerConnection,\n+   * the codec/RTP/RTCP options supported by this implementation, and any\n+   * candidates that have been gathered by the ICE Agent. The options parameter\n+   * may be supplied to provide additional control over the offer generated.\n+   *\n+   * As an offer, the generated SDP will contain the full set of capabilities\n+   * supported by the session (as opposed to an answer, which will include only\n+   * a specific negotiated subset to use); for each SDP line, the generation\n+   * of the SDP must follow the appropriate process for generating an offer.\n+   * In the event createOffer is called after the session is established,\n+   * createOffer will generate an offer that is compatible with the current\n+   * session, incorporating any changes that have been made to the session\n+   * since the last complete offer-answer exchange, such as addition or removal\n+   * of streams. If no changes have been made, the offer will include the\n+   * capabilities of the current local description as well as any additional\n+   * capabilities that could be negotiated in an updated offer.\n+   *\n+   * Session descriptions generated by createOffer must be immediately usable\n+   * by setLocalDescription without causing an error as long as\n+   * setLocalDescription is called reasonably soon. If a system has limited\n+   * resources (e.g. a finite number of decoders), createOffer needs to return\n+   * an offer that reflects the current state of the system, so that\n+   * setLocalDescription will succeed when it attempts to acquire those\n+   * resources. The session descriptions must remain usable by\n+   * setLocalDescription without causing an error until at least the end of\n+   * the fulfillment callback of the returned promise. Calling this method\n+   * is needed to get the ICE user name fragment and password.\n+   *\n+   * If the RTCPeerConnection is configured to generate Identity assertions,\n+   * then the session description shall contain an appropriate assertion.\n+   *\n+   * If this RTCPeerConnection object is closed before the SDP generation\n+   * process completes, the USER agent must suppress the result and not resolve\n+   * or reject the returned promise.\n+   *\n+   * If the SDP generation process completed successfully, the user agent must\n+   * resolve the returned promise with a newly created RTCSessionDescription\n+   * object, representing the generated offer.\n+   *\n+   * If the SDP generation process failed for any reason, the user agent must\n+   * reject the returned promise with an DOMError object of type TBD as its\n+   * argument.\n+   *\n+   * To Do: Discuss privacy aspects of this from a fingerprinting point of\n+   * view - it's probably around as bad as access to a canvas :-)\n+   *\n+   * Parameter\tType\tNullable\tOptional\tDescription\n+   * options\tRTCOfferOptions\t✘\t✔\n+   * Return type: Promise<RTCSessionDescription>\n+   */\n+  def createOffer(\n+      options: js.UndefOr[RTCOfferOptions] = js.undefined): Promise[RTCSessionDescription] = js.native\n+\n+  /**\n+   * The createAnswer method generates an [SDP] answer with the supported\n+   * configuration for the session that is compatible with the parameters in\n+   * the remote configuration. Like createOffer, the returned blob contains\n+   * descriptions of the local MediaStreams attached to this RTCPeerConnection,\n+   * the codec/RTP/RTCP options negotiated for this session, and any candidates\n+   * that have been gathered by the ICE Agent. The options parameter may be\n+   * supplied to provide additional control over the generated answer.\n+   *\n+   * As an answer, the generated SDP will contain a specific configuration\n+   * that, along with the corresponding offer, specifies how the media plane\n+   * should be established. The generation of the SDP must follow the\n+   * appropriate process for generating an answer.\n+   *\n+   * Session descriptions generated by createAnswer must be immediately usable\n+   * by setLocalDescription without causing an error as long as\n+   * setLocalDescription is called reasonably soon. Like createOffer, the\n+   * returned description should reflect the current state of the system. The\n+   * session descriptions must remain usable by setLocalDescription without\n+   * causing an error until at least the end of the fulfillment callback of\n+   * the returned promise. Calling this method is needed to get the ICE user\n+   * name fragment and password.\n+   *\n+   * An answer can be marked as provisional, as described in [RTCWEB-JSEP], by\n+   * setting the type to \"pranswer\".\n+   *\n+   * If the RTCPeerConnection is configured to generate Identity assertions,\n+   * then the session description shall contain an appropriate assertion.\n+   *\n+   * If this RTCPeerConnection object is closed before the SDP generation process\n+   * completes, the USER agent must suppress the result and not resolve or reject\n+   * the returned promise.\n+   *\n+   * If the SDP generation process completed successfully, the user agent must\n+   * resolve the returned promise with a newly created RTCSessionDescription\n+   * object, representing the generated answer.\n+   *\n+   * If the SDP generation process failed for any reason, the user agent must\n+   * reject the returned promise with a DOMError object of type TBD.\n+   *\n+   * No parameters.\n+   * Return type: Promise<RTCSessionDescription>\n+   */\n+  def createAnswer(): Promise[RTCSessionDescription] = js.native\n+\n+  /**\n+   * Changes the local description associated with the connection. The\n+   * description defines the properties of the connection like its codec. The\n+   * connection is affected by this change and must be able to support both\n+   * old and new descriptions. The method takes one parameters, a\n+   * RTCSessionDescription object to set, and returns a Promise.\n+   *\n+   * MDN\n+   */\n+  def setLocalDescription(\n+      description: RTCSessionDescription): Promise[Any] = js.native\n+\n+  /**\n+   * Changes the remote description associated with the connection. The\n+   * description defines the properties of the connection like its codec.\n+   * The connection is affected by this change and must be able to support\n+   * both old and new descriptions. The method takes one parameters, a\n+   * RTCSessionDescription object to set, and returns a Promise.\n+   *\n+   * MDN\n+   */\n+  def setRemoteDescription(\n+      description: RTCSessionDescription): Promise[Any] = js.native\n+\n+  /**\n+   * The updateIce method updates the ICE Agent process of gathering local\n+   * candidates and pinging remote candidates. If there is a mandatory\n+   * constraint called \"IceTransports\" it will control how the ICE engine\n+   * can act. This can be used to limit the use to TURN candidates by a callee\n+   * to avoid leaking location information prior to the call being accepted.\n+   * This call may result in a change to the state of the ICE Agent, and may\n+   * result in a change to media state if it results in connectivity being\n+   * established\n+   *\n+   * MDN\n+   */\n+  def updateIce(\n+      configuration: js.UndefOr[RTCConfiguration] = js.undefined): Unit = js.native\n+\n+  /**\n+   * The addIceCandidate() method provides a remote candidate to the ICE Agent.\n+   * In addition to being added to the remote description, connectivity checks\n+   * will be sent to the new candidates as long as the \"IceTransports\"\n+   * constraint is not set to \"none\". This call will result in a change to the\n+   * connection state of the ICE Agent, and may result in a change to media\n+   * state if it results in different connectivity being established.\n+   *\n+   * MDN\n+   */\n+  def addIceCandidate(\n+      candidate: RTCIceCandidate): Promise[Any] = js.native\n+\n+  def getConfiguration(): RTCConfiguration = js.native\n+\n+  /**\n+   * Returns an array of MediaStream associated with the local end of the\n+   * connection. The array may be empty.\n+   *\n+   * MDN\n+   */\n+  def getLocalStreams(): js.Array[MediaStream] = js.native\n+\n+  /**\n+   * Returns an array of MediaStream associated with the remote end of the\n+   * connection. The array may be empty.\n+   *\n+   * MDN\n+   */\n+  def getRemoteStreams(): js.Array[MediaStream] = js.native\n+\n+  /**\n+   * Returns the MediaStream with the given id that is associated with local\n+   * or remote end of the connection. If no stream matches, it returns null.\n+   *\n+   * MDN\n+   */\n+  def getStreamById(id: String): MediaStream = js.native\n+\n+  /**\n+   * Adds a MediaStream as a local source of audio or video. If the\n+   * negotiation already happened, a new one will be needed for the remote\n+   * peer to be able to use it.\n+   *\n+   * MDN\n+   */\n+  def addStream(stream: MediaStream): Unit = js.native\n+\n+  /**\n+   * Removes a MediaStream as a local source of audio or video. If the\n+   * negotiation already happened, a new one will be needed for the remote\n+   * peer to stop using it.\n+   *\n+   * MDN\n+   */\n+  def removeStream(stream: MediaStream): Unit = js.native\n+\n+  /**\n+   * Abruptly closes a connection.\n+   *\n+   * MDN\n+   */\n+  def close(): Unit = js.native\n+\n+  /**\n+   * Creates a new RTCDataChannel associated with this connection. The method\n+   * takes a dictionary as parameter, with the configuration required for the\n+   * underlying data channel, like its reliability.\n+   *\n+   * MDN\n+   */\n+  def createDataChannel(\n+      label: String,\n+      options: js.UndefOr[RTCDataChannelInit] = js.undefined): RTCDataChannel = js.native\n+\n+  /**\n+   * Creates a new RTCDTMFSender, associated to a specific MediaStreamTrack,\n+   * that will be able to send DTMF phone signaling over the connection.\n+   *\n+   * MDN\n+   */\n+  def createDTMFSender(track: MediaStreamTrack): RTCDTMFSender = js.native\n+\n+  /**\n+   * Creates a new RTCStatsReport that contains and allows access to statistics\n+   * regarding the connection.\n+   *\n+   * MDN\n+   */\n+  def getStats(\n+      selector: MediaStreamTrack,\n+      callback: js.Function1[RTCStatsReport, Any],\n+      error: js.Function1[DOMError, Any]): RTCStatsReport = js.native\n+\n+  /**\n+   * Sets the identity provider to be used for a given RTCPeerConnection object.\n+   * Applications need not make this call; if the browser is already configured\n+   * for an IdP, then that configured IdP might be used to get an assertion.\n+   *\n+   * When the setIdentityProvider() method is invoked, the user agent must run the\n+   * following steps:\n+   *    If the connection's RTCPeerConnection signalingState is closed, throw\n+   *    an InvalidStateError exception and abort these steps.\n+   *\n+   *    Set the current identity provider values to the triplet (provider,\n+   *    protocol, usernameHint).\n+   *\n+   *    If any identity provider value has changed, discard any stored identity\n+   *    assertion.\n+   *\n+   *    Identity provider information is not used until an identity assertion\n+   *    is required, either in response to a call to getIdentityAssertion, or a\n+   *    session description is requested with a call to either createOffer or\n+   *    createAnswer.\n+   */\n+  def setIdentityProvider(\n+      provider: String,\n+      protocol: String,\n+      usernameHint: String): Unit = js.native\n+","path":"src/main/scala/org/scalajs/dom/experimental/webrtc/WebRTC.scala","position":839,"original_position":839,"commit_id":"4655c18be36d46b5b8614641f74eff3adaef0f03","original_commit_id":"4655c18be36d46b5b8614641f74eff3adaef0f03","user":{"login":"mseddon","id":4021991,"avatar_url":"https://avatars.githubusercontent.com/u/4021991?v=3","gravatar_id":"","url":"https://api.github.com/users/mseddon","html_url":"https://github.com/mseddon","followers_url":"https://api.github.com/users/mseddon/followers","following_url":"https://api.github.com/users/mseddon/following{/other_user}","gists_url":"https://api.github.com/users/mseddon/gists{/gist_id}","starred_url":"https://api.github.com/users/mseddon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mseddon/subscriptions","organizations_url":"https://api.github.com/users/mseddon/orgs","repos_url":"https://api.github.com/users/mseddon/repos","events_url":"https://api.github.com/users/mseddon/events{/privacy}","received_events_url":"https://api.github.com/users/mseddon/received_events","type":"User","site_admin":false},"body":"`protocol: String = js.native` and `usernameHint: String = js.native` - these are optional.","created_at":"2016-01-21T10:24:05Z","updated_at":"2016-01-21T10:24:05Z","html_url":"https://github.com/scala-js/scala-js-dom/pull/203#discussion_r50382773","pull_request_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/203","_links":{"self":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/comments/50382773"},"html":{"href":"https://github.com/scala-js/scala-js-dom/pull/203#discussion_r50382773"},"pull_request":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/203"}}},"pull_request":{"url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/203","id":56648079,"html_url":"https://github.com/scala-js/scala-js-dom/pull/203","diff_url":"https://github.com/scala-js/scala-js-dom/pull/203.diff","patch_url":"https://github.com/scala-js/scala-js-dom/pull/203.patch","issue_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/203","number":203,"state":"open","locked":false,"title":"WebRTC Additions","user":{"login":"coreyauger","id":1414300,"avatar_url":"https://avatars.githubusercontent.com/u/1414300?v=3","gravatar_id":"","url":"https://api.github.com/users/coreyauger","html_url":"https://github.com/coreyauger","followers_url":"https://api.github.com/users/coreyauger/followers","following_url":"https://api.github.com/users/coreyauger/following{/other_user}","gists_url":"https://api.github.com/users/coreyauger/gists{/gist_id}","starred_url":"https://api.github.com/users/coreyauger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreyauger/subscriptions","organizations_url":"https://api.github.com/users/coreyauger/orgs","repos_url":"https://api.github.com/users/coreyauger/repos","events_url":"https://api.github.com/users/coreyauger/events{/privacy}","received_events_url":"https://api.github.com/users/coreyauger/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-20T18:31:19Z","updated_at":"2016-01-21T10:24:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1695e24bef9f684090c904cd3a214dcde6297309","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/203/commits","review_comments_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/203/comments","review_comment_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/203/comments","statuses_url":"https://api.github.com/repos/scala-js/scala-js-dom/statuses/4655c18be36d46b5b8614641f74eff3adaef0f03","head":{"label":"coreyauger:webrtc-api","ref":"webrtc-api","sha":"4655c18be36d46b5b8614641f74eff3adaef0f03","user":{"login":"coreyauger","id":1414300,"avatar_url":"https://avatars.githubusercontent.com/u/1414300?v=3","gravatar_id":"","url":"https://api.github.com/users/coreyauger","html_url":"https://github.com/coreyauger","followers_url":"https://api.github.com/users/coreyauger/followers","following_url":"https://api.github.com/users/coreyauger/following{/other_user}","gists_url":"https://api.github.com/users/coreyauger/gists{/gist_id}","starred_url":"https://api.github.com/users/coreyauger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreyauger/subscriptions","organizations_url":"https://api.github.com/users/coreyauger/orgs","repos_url":"https://api.github.com/users/coreyauger/repos","events_url":"https://api.github.com/users/coreyauger/events{/privacy}","received_events_url":"https://api.github.com/users/coreyauger/received_events","type":"User","site_admin":false},"repo":{"id":41752284,"name":"scala-js-dom","full_name":"coreyauger/scala-js-dom","owner":{"login":"coreyauger","id":1414300,"avatar_url":"https://avatars.githubusercontent.com/u/1414300?v=3","gravatar_id":"","url":"https://api.github.com/users/coreyauger","html_url":"https://github.com/coreyauger","followers_url":"https://api.github.com/users/coreyauger/followers","following_url":"https://api.github.com/users/coreyauger/following{/other_user}","gists_url":"https://api.github.com/users/coreyauger/gists{/gist_id}","starred_url":"https://api.github.com/users/coreyauger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreyauger/subscriptions","organizations_url":"https://api.github.com/users/coreyauger/orgs","repos_url":"https://api.github.com/users/coreyauger/repos","events_url":"https://api.github.com/users/coreyauger/events{/privacy}","received_events_url":"https://api.github.com/users/coreyauger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coreyauger/scala-js-dom","description":"statically typed dom wrappers for scala-js","fork":true,"url":"https://api.github.com/repos/coreyauger/scala-js-dom","forks_url":"https://api.github.com/repos/coreyauger/scala-js-dom/forks","keys_url":"https://api.github.com/repos/coreyauger/scala-js-dom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreyauger/scala-js-dom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreyauger/scala-js-dom/teams","hooks_url":"https://api.github.com/repos/coreyauger/scala-js-dom/hooks","issue_events_url":"https://api.github.com/repos/coreyauger/scala-js-dom/issues/events{/number}","events_url":"https://api.github.com/repos/coreyauger/scala-js-dom/events","assignees_url":"https://api.github.com/repos/coreyauger/scala-js-dom/assignees{/user}","branches_url":"https://api.github.com/repos/coreyauger/scala-js-dom/branches{/branch}","tags_url":"https://api.github.com/repos/coreyauger/scala-js-dom/tags","blobs_url":"https://api.github.com/repos/coreyauger/scala-js-dom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreyauger/scala-js-dom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreyauger/scala-js-dom/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreyauger/scala-js-dom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreyauger/scala-js-dom/statuses/{sha}","languages_url":"https://api.github.com/repos/coreyauger/scala-js-dom/languages","stargazers_url":"https://api.github.com/repos/coreyauger/scala-js-dom/stargazers","contributors_url":"https://api.github.com/repos/coreyauger/scala-js-dom/contributors","subscribers_url":"https://api.github.com/repos/coreyauger/scala-js-dom/subscribers","subscription_url":"https://api.github.com/repos/coreyauger/scala-js-dom/subscription","commits_url":"https://api.github.com/repos/coreyauger/scala-js-dom/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreyauger/scala-js-dom/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreyauger/scala-js-dom/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreyauger/scala-js-dom/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreyauger/scala-js-dom/contents/{+path}","compare_url":"https://api.github.com/repos/coreyauger/scala-js-dom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreyauger/scala-js-dom/merges","archive_url":"https://api.github.com/repos/coreyauger/scala-js-dom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreyauger/scala-js-dom/downloads","issues_url":"https://api.github.com/repos/coreyauger/scala-js-dom/issues{/number}","pulls_url":"https://api.github.com/repos/coreyauger/scala-js-dom/pulls{/number}","milestones_url":"https://api.github.com/repos/coreyauger/scala-js-dom/milestones{/number}","notifications_url":"https://api.github.com/repos/coreyauger/scala-js-dom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreyauger/scala-js-dom/labels{/name}","releases_url":"https://api.github.com/repos/coreyauger/scala-js-dom/releases{/id}","created_at":"2015-09-01T17:12:15Z","updated_at":"2015-09-01T17:12:15Z","pushed_at":"2016-01-21T08:31:32Z","git_url":"git://github.com/coreyauger/scala-js-dom.git","ssh_url":"git@github.com:coreyauger/scala-js-dom.git","clone_url":"https://github.com/coreyauger/scala-js-dom.git","svn_url":"https://github.com/coreyauger/scala-js-dom","homepage":null,"size":2104,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scala-js:master","ref":"master","sha":"2e0af97002110eb2da5b295f489aee20c38eff5c","user":{"login":"scala-js","id":6039724,"avatar_url":"https://avatars.githubusercontent.com/u/6039724?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-js","html_url":"https://github.com/scala-js","followers_url":"https://api.github.com/users/scala-js/followers","following_url":"https://api.github.com/users/scala-js/following{/other_user}","gists_url":"https://api.github.com/users/scala-js/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-js/subscriptions","organizations_url":"https://api.github.com/users/scala-js/orgs","repos_url":"https://api.github.com/users/scala-js/repos","events_url":"https://api.github.com/users/scala-js/events{/privacy}","received_events_url":"https://api.github.com/users/scala-js/received_events","type":"Organization","site_admin":false},"repo":{"id":13578796,"name":"scala-js-dom","full_name":"scala-js/scala-js-dom","owner":{"login":"scala-js","id":6039724,"avatar_url":"https://avatars.githubusercontent.com/u/6039724?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-js","html_url":"https://github.com/scala-js","followers_url":"https://api.github.com/users/scala-js/followers","following_url":"https://api.github.com/users/scala-js/following{/other_user}","gists_url":"https://api.github.com/users/scala-js/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-js/subscriptions","organizations_url":"https://api.github.com/users/scala-js/orgs","repos_url":"https://api.github.com/users/scala-js/repos","events_url":"https://api.github.com/users/scala-js/events{/privacy}","received_events_url":"https://api.github.com/users/scala-js/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-js/scala-js-dom","description":"statically typed dom wrappers for scala-js","fork":false,"url":"https://api.github.com/repos/scala-js/scala-js-dom","forks_url":"https://api.github.com/repos/scala-js/scala-js-dom/forks","keys_url":"https://api.github.com/repos/scala-js/scala-js-dom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-js/scala-js-dom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-js/scala-js-dom/teams","hooks_url":"https://api.github.com/repos/scala-js/scala-js-dom/hooks","issue_events_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/events{/number}","events_url":"https://api.github.com/repos/scala-js/scala-js-dom/events","assignees_url":"https://api.github.com/repos/scala-js/scala-js-dom/assignees{/user}","branches_url":"https://api.github.com/repos/scala-js/scala-js-dom/branches{/branch}","tags_url":"https://api.github.com/repos/scala-js/scala-js-dom/tags","blobs_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-js/scala-js-dom/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-js/scala-js-dom/languages","stargazers_url":"https://api.github.com/repos/scala-js/scala-js-dom/stargazers","contributors_url":"https://api.github.com/repos/scala-js/scala-js-dom/contributors","subscribers_url":"https://api.github.com/repos/scala-js/scala-js-dom/subscribers","subscription_url":"https://api.github.com/repos/scala-js/scala-js-dom/subscription","commits_url":"https://api.github.com/repos/scala-js/scala-js-dom/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-js/scala-js-dom/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala-js/scala-js-dom/contents/{+path}","compare_url":"https://api.github.com/repos/scala-js/scala-js-dom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-js/scala-js-dom/merges","archive_url":"https://api.github.com/repos/scala-js/scala-js-dom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-js/scala-js-dom/downloads","issues_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues{/number}","pulls_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-js/scala-js-dom/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-js/scala-js-dom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-js/scala-js-dom/labels{/name}","releases_url":"https://api.github.com/repos/scala-js/scala-js-dom/releases{/id}","created_at":"2013-10-15T02:35:07Z","updated_at":"2016-01-11T08:50:50Z","pushed_at":"2016-01-21T09:51:21Z","git_url":"git://github.com/scala-js/scala-js-dom.git","ssh_url":"git@github.com:scala-js/scala-js-dom.git","clone_url":"https://github.com/scala-js/scala-js-dom.git","svn_url":"https://github.com/scala-js/scala-js-dom","homepage":null,"size":2259,"stargazers_count":105,"watchers_count":105,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":50,"mirror_url":null,"open_issues_count":18,"forks":50,"open_issues":18,"watchers":105,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/203"},"html":{"href":"https://github.com/scala-js/scala-js-dom/pull/203"},"issue":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/issues/203"},"comments":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/issues/203/comments"},"review_comments":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/203/comments"},"review_comment":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/203/commits"},"statuses":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/statuses/4655c18be36d46b5b8614641f74eff3adaef0f03"}}}}