@@ -10,7 +10,7 @@ import scala.scalajs.js.|
1010
1111import org .scalajs .dom .Blob
1212import org .scalajs .dom .raw .{
13- DOMError , Event , EventInit , EventTarget , MessageEvent
13+ DOMException , Event , EventInit , EventTarget , MessageEvent
1414}
1515import org .scalajs .dom .experimental .mediastream ._
1616
@@ -1036,98 +1036,31 @@ class RTCPeerConnection(
10361036 var onsignalingstatechange : js.Function1 [Event , Any ] = js.native
10371037
10381038 /**
1039- * The createOffer method generates a blob of SDP that contains an RFC 3264
1040- * offer with the supported configurations for the session, including
1041- * descriptions of the local MediaStreams attached to this RTCPeerConnection,
1042- * the codec/RTP/RTCP options supported by this implementation, and any
1043- * candidates that have been gathered by the ICE Agent. The options parameter
1044- * may be supplied to provide additional control over the offer generated.
1045- *
1046- * As an offer, the generated SDP will contain the full set of capabilities
1047- * supported by the session (as opposed to an answer, which will include only
1048- * a specific negotiated subset to use); for each SDP line, the generation
1049- * of the SDP must follow the appropriate process for generating an offer.
1050- * In the event createOffer is called after the session is established,
1051- * createOffer will generate an offer that is compatible with the current
1052- * session, incorporating any changes that have been made to the session
1053- * since the last complete offer-answer exchange, such as addition or removal
1054- * of streams. If no changes have been made, the offer will include the
1055- * capabilities of the current local description as well as any additional
1056- * capabilities that could be negotiated in an updated offer.
1057- *
1058- * Session descriptions generated by createOffer must be immediately usable
1059- * by setLocalDescription without causing an error as long as
1060- * setLocalDescription is called reasonably soon. If a system has limited
1061- * resources (e.g. a finite number of decoders), createOffer needs to return
1062- * an offer that reflects the current state of the system, so that
1063- * setLocalDescription will succeed when it attempts to acquire those
1064- * resources. The session descriptions must remain usable by
1065- * setLocalDescription without causing an error until at least the end of
1066- * the fulfillment callback of the returned promise. Calling this method
1067- * is needed to get the ICE user name fragment and password.
1068- *
1069- * If the RTCPeerConnection is configured to generate Identity assertions,
1070- * then the session description shall contain an appropriate assertion.
1071- *
1072- * If this RTCPeerConnection object is closed before the SDP generation
1073- * process completes, the USER agent must suppress the result and not resolve
1074- * or reject the returned promise.
1075- *
1076- * If the SDP generation process completed successfully, the user agent must
1077- * resolve the returned promise with a newly created RTCSessionDescription
1078- * object, representing the generated offer.
1079- *
1080- * If the SDP generation process failed for any reason, the user agent must
1081- * reject the returned promise with an DOMError object of type TBD as its
1082- * argument.
1083- *
1084- * To Do: Discuss privacy aspects of this from a fingerprinting point of
1085- * view - it's probably around as bad as access to a canvas :-)
1039+ * The createOffer() method of the RTCPeerConnection interface initiates the
1040+ * creation of an SDP offer for the purpose of starting a new WebRTC connection
1041+ * to a remote peer. The SDP offer includes information about any MediaStreamTracks
1042+ * already attached to the WebRTC session, codec, and options supported by the
1043+ * browser, and any candidates already gathered by the ICE agent, for the purpose
1044+ * of being sent over the signaling channel to a potential peer to request a connection
1045+ * or to update the configuration of an existing connection.
10861046 *
1047+ * The return value is a Promise which, when the offer has been created, is resolved
1048+ * with a RTCSessionDescription object containing the newly-created offer.
1049+ *
1050+ * MDN
10871051 */
10881052 def createOffer (
10891053 options : RTCOfferOptions = js.native): js.Promise [RTCSessionDescription ] = js.native
10901054
10911055 /**
1092- * The createAnswer method generates an [SDP] answer with the supported
1093- * configuration for the session that is compatible with the parameters in
1094- * the remote configuration. Like createOffer, the returned blob contains
1095- * descriptions of the local MediaStreams attached to this RTCPeerConnection,
1096- * the codec/RTP/RTCP options negotiated for this session, and any candidates
1097- * that have been gathered by the ICE Agent. The options parameter may be
1098- * supplied to provide additional control over the generated answer.
1099- *
1100- * As an answer, the generated SDP will contain a specific configuration
1101- * that, along with the corresponding offer, specifies how the media plane
1102- * should be established. The generation of the SDP must follow the
1103- * appropriate process for generating an answer.
1104- *
1105- * Session descriptions generated by createAnswer must be immediately usable
1106- * by setLocalDescription without causing an error as long as
1107- * setLocalDescription is called reasonably soon. Like createOffer, the
1108- * returned description should reflect the current state of the system. The
1109- * session descriptions must remain usable by setLocalDescription without
1110- * causing an error until at least the end of the fulfillment callback of
1111- * the returned promise. Calling this method is needed to get the ICE user
1112- * name fragment and password.
1113- *
1114- * An answer can be marked as provisional, as described in [RTCWEB-JSEP], by
1115- * setting the type to "pranswer".
1116- *
1117- * If the RTCPeerConnection is configured to generate Identity assertions,
1118- * then the session description shall contain an appropriate assertion.
1119- *
1120- * If this RTCPeerConnection object is closed before the SDP generation process
1121- * completes, the USER agent must suppress the result and not resolve or reject
1122- * the returned promise.
1123- *
1124- * If the SDP generation process completed successfully, the user agent must
1125- * resolve the returned promise with a newly created RTCSessionDescription
1126- * object, representing the generated answer.
1127- *
1128- * If the SDP generation process failed for any reason, the user agent must
1129- * reject the returned promise with a DOMError object of type TBD.
1056+ * The createAnswer() method on the RTCPeerConnection interface creates an SDP answer to
1057+ * an offer received from a remote peer during the offer/answer negotiation of a WebRTC
1058+ * connection. The answer contains information about any media already attached to the
1059+ * session, codecs and options supported by the browser, and any ICE candidates already
1060+ * gathered. The answer is delivered to the returned Promise, and should then be sent to
1061+ * the source of the offer to continue the negotiation process.
11301062 *
1063+ * MDN
11311064 */
11321065 def createAnswer (): js.Promise [RTCSessionDescription ] = js.native
11331066
@@ -1258,7 +1191,7 @@ class RTCPeerConnection(
12581191 */
12591192 def getStats (selector : MediaStreamTrack ,
12601193 callback : js.Function1 [RTCStatsReport , Any ],
1261- error : js.Function1 [DOMError , Any ]): RTCStatsReport = js.native
1194+ error : js.Function1 [DOMException , Any ]): RTCStatsReport = js.native
12621195
12631196 /**
12641197 * Sets the identity provider to be used for a given RTCPeerConnection object.
0 commit comments