-
Notifications
You must be signed in to change notification settings - Fork 161
Fix #374: Deprecate DOMError in favor of DOMException. #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import scala.scalajs.js.| | |
|
||
import org.scalajs.dom.Blob | ||
import org.scalajs.dom.raw.{ | ||
DOMError, Event, EventInit, EventTarget, MessageEvent | ||
DOMException, Event, EventInit, EventTarget, MessageEvent | ||
} | ||
import org.scalajs.dom.experimental.mediastream._ | ||
|
||
|
@@ -1036,98 +1036,31 @@ class RTCPeerConnection( | |
var onsignalingstatechange: js.Function1[Event, Any] = js.native | ||
|
||
/** | ||
* The createOffer method generates a blob of SDP that contains an RFC 3264 | ||
* offer with the supported configurations for the session, including | ||
* descriptions of the local MediaStreams attached to this RTCPeerConnection, | ||
* the codec/RTP/RTCP options supported by this implementation, and any | ||
* candidates that have been gathered by the ICE Agent. The options parameter | ||
* may be supplied to provide additional control over the offer generated. | ||
* | ||
* As an offer, the generated SDP will contain the full set of capabilities | ||
* supported by the session (as opposed to an answer, which will include only | ||
* a specific negotiated subset to use); for each SDP line, the generation | ||
* of the SDP must follow the appropriate process for generating an offer. | ||
* In the event createOffer is called after the session is established, | ||
* createOffer will generate an offer that is compatible with the current | ||
* session, incorporating any changes that have been made to the session | ||
* since the last complete offer-answer exchange, such as addition or removal | ||
* of streams. If no changes have been made, the offer will include the | ||
* capabilities of the current local description as well as any additional | ||
* capabilities that could be negotiated in an updated offer. | ||
* | ||
* Session descriptions generated by createOffer must be immediately usable | ||
* by setLocalDescription without causing an error as long as | ||
* setLocalDescription is called reasonably soon. If a system has limited | ||
* resources (e.g. a finite number of decoders), createOffer needs to return | ||
* an offer that reflects the current state of the system, so that | ||
* setLocalDescription will succeed when it attempts to acquire those | ||
* resources. The session descriptions must remain usable by | ||
* setLocalDescription without causing an error until at least the end of | ||
* the fulfillment callback of the returned promise. Calling this method | ||
* is needed to get the ICE user name fragment and password. | ||
* | ||
* If the RTCPeerConnection is configured to generate Identity assertions, | ||
* then the session description shall contain an appropriate assertion. | ||
* | ||
* If this RTCPeerConnection object is closed before the SDP generation | ||
* process completes, the USER agent must suppress the result and not resolve | ||
* or reject the returned promise. | ||
* | ||
* If the SDP generation process completed successfully, the user agent must | ||
* resolve the returned promise with a newly created RTCSessionDescription | ||
* object, representing the generated offer. | ||
* | ||
* If the SDP generation process failed for any reason, the user agent must | ||
* reject the returned promise with an DOMError object of type TBD as its | ||
* argument. | ||
* | ||
* To Do: Discuss privacy aspects of this from a fingerprinting point of | ||
* view - it's probably around as bad as access to a canvas :-) | ||
* The createOffer() method of the RTCPeerConnection interface initiates the | ||
* creation of an SDP offer for the purpose of starting a new WebRTC connection | ||
* to a remote peer. The SDP offer includes information about any MediaStreamTracks | ||
* already attached to the WebRTC session, codec, and options supported by the | ||
* browser, and any candidates already gathered by the ICE agent, for the purpose | ||
* of being sent over the signaling channel to a potential peer to request a connection | ||
* or to update the configuration of an existing connection. | ||
* | ||
* The return value is a Promise which, when the offer has been created, is resolved | ||
* with a RTCSessionDescription object containing the newly-created offer. | ||
* | ||
* MDN | ||
*/ | ||
def createOffer( | ||
options: RTCOfferOptions = js.native): js.Promise[RTCSessionDescription] = js.native | ||
|
||
/** | ||
* The createAnswer method generates an [SDP] answer with the supported | ||
* configuration for the session that is compatible with the parameters in | ||
* the remote configuration. Like createOffer, the returned blob contains | ||
* descriptions of the local MediaStreams attached to this RTCPeerConnection, | ||
* the codec/RTP/RTCP options negotiated for this session, and any candidates | ||
* that have been gathered by the ICE Agent. The options parameter may be | ||
* supplied to provide additional control over the generated answer. | ||
* | ||
* As an answer, the generated SDP will contain a specific configuration | ||
* that, along with the corresponding offer, specifies how the media plane | ||
* should be established. The generation of the SDP must follow the | ||
* appropriate process for generating an answer. | ||
* | ||
* Session descriptions generated by createAnswer must be immediately usable | ||
* by setLocalDescription without causing an error as long as | ||
* setLocalDescription is called reasonably soon. Like createOffer, the | ||
* returned description should reflect the current state of the system. The | ||
* session descriptions must remain usable by setLocalDescription without | ||
* causing an error until at least the end of the fulfillment callback of | ||
* the returned promise. Calling this method is needed to get the ICE user | ||
* name fragment and password. | ||
* | ||
* An answer can be marked as provisional, as described in [RTCWEB-JSEP], by | ||
* setting the type to "pranswer". | ||
* | ||
* If the RTCPeerConnection is configured to generate Identity assertions, | ||
* then the session description shall contain an appropriate assertion. | ||
* | ||
* If this RTCPeerConnection object is closed before the SDP generation process | ||
* completes, the USER agent must suppress the result and not resolve or reject | ||
* the returned promise. | ||
* | ||
* If the SDP generation process completed successfully, the user agent must | ||
* resolve the returned promise with a newly created RTCSessionDescription | ||
* object, representing the generated answer. | ||
* | ||
* If the SDP generation process failed for any reason, the user agent must | ||
* reject the returned promise with a DOMError object of type TBD. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
* The createAnswer() method on the RTCPeerConnection interface creates an SDP answer to | ||
* an offer received from a remote peer during the offer/answer negotiation of a WebRTC | ||
* connection. The answer contains information about any media already attached to the | ||
* session, codecs and options supported by the browser, and any ICE candidates already | ||
* gathered. The answer is delivered to the returned Promise, and should then be sent to | ||
* the source of the offer to continue the negotiation process. | ||
* | ||
* MDN | ||
floating-cat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
def createAnswer(): js.Promise[RTCSessionDescription] = js.native | ||
|
||
|
@@ -1258,7 +1191,7 @@ class RTCPeerConnection( | |
*/ | ||
def getStats(selector: MediaStreamTrack, | ||
callback: js.Function1[RTCStatsReport, Any], | ||
error: js.Function1[DOMError, Any]): RTCStatsReport = js.native | ||
error: js.Function1[DOMException, Any]): RTCStatsReport = js.native | ||
|
||
/** | ||
* Sets the identity provider to be used for a given RTCPeerConnection object. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
package org.scalajs.dom.experimental | ||
|
||
import org.scalajs.dom.DOMError | ||
import org.scalajs.dom.experimental.mediastream._ | ||
import org.scalajs.dom.raw.DOMException | ||
|
||
import scala.scalajs.js | ||
import scala.language.implicitConversions | ||
|
||
|
@@ -26,7 +27,7 @@ package object webrtc { | |
"Navigator.getUserMedia() is deprecated, use Navigator.mediaDevices.getUserMedia() instead.", | ||
"2014-05-28") | ||
def getUserMedia(constraints: MediaStreamConstraints, | ||
success: js.Function1[MediaStream, Any], | ||
error: js.Function1[DOMError, Any]): Unit = js.native | ||
successCallback: js.Function1[MediaStream, Any], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find this method argument names are incorrect[1], so I updated these two arugment names. |
||
errorCallback: js.Function1[DOMException, Any]): Unit = js.native | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method documentation came from WebRTC spec, but the latest spec for this method documentation changes a lot.
Because this comment mentioned
DOMError
, so I guess I need update this comment too, so I replace this method documentation with the MDN one. I am glad to revert this large documentation change if needed.