mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 15:16:52 +08:00
Remove new RTCSessionDescription
pattern
SetRemoteDescription accepts a RTCSessionDescriptionInit so this is no longer needed Resolves #2324
This commit is contained in:
@@ -150,6 +150,7 @@ ronan <ronan.jezequel@gmail.com>
|
|||||||
Ryan Shumate <Ryan.Shumate@garmin.com>
|
Ryan Shumate <Ryan.Shumate@garmin.com>
|
||||||
salmān aljammāz <s@aljmz.com>
|
salmān aljammāz <s@aljmz.com>
|
||||||
Sam Lancia <sam@vaion.com>
|
Sam Lancia <sam@vaion.com>
|
||||||
|
Sean DuBois <duboisea@justin.tv>
|
||||||
Sean DuBois <duboisea@twitch.tv>
|
Sean DuBois <duboisea@twitch.tv>
|
||||||
Sean DuBois <seaduboi@amazon.com>
|
Sean DuBois <seaduboi@amazon.com>
|
||||||
Sean DuBois <sean@siobud.com>
|
Sean DuBois <sean@siobud.com>
|
||||||
|
@@ -91,7 +91,7 @@ func TestE2E_Audio(t *testing.T) {
|
|||||||
}
|
}
|
||||||
var result string
|
var result string
|
||||||
if err := page.RunScript(
|
if err := page.RunScript(
|
||||||
"pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(answer)))",
|
"pc.setRemoteDescription(JSON.parse(answer))",
|
||||||
map[string]interface{}{"answer": string(answerBytes)},
|
map[string]interface{}{"answer": string(answerBytes)},
|
||||||
&result,
|
&result,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
@@ -231,7 +231,7 @@ func TestE2E_DataChannel(t *testing.T) {
|
|||||||
}
|
}
|
||||||
var result string
|
var result string
|
||||||
if err := page.RunScript(
|
if err := page.RunScript(
|
||||||
"pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(answer)))",
|
"pc.setRemoteDescription(JSON.parse(answer))",
|
||||||
map[string]interface{}{"answer": string(answerBytes)},
|
map[string]interface{}{"answer": string(answerBytes)},
|
||||||
&result,
|
&result,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
|
@@ -11,7 +11,7 @@ go get github.com/pion/webrtc/v3/examples/broadcast
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open broadcast example page
|
### Open broadcast example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/ypcsbnu3/) You should see two buttons `Publish a Broadcast` and `Join a Broadcast`
|
[jsfiddle.net](https://jsfiddle.net/us4h58jx/) You should see two buttons `Publish a Broadcast` and `Join a Broadcast`
|
||||||
|
|
||||||
### Run Broadcast
|
### Run Broadcast
|
||||||
#### Linux/macOS
|
#### Linux/macOS
|
||||||
|
@@ -48,7 +48,7 @@ window.createSession = isPublisher => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ go get github.com/pion/webrtc/v3/examples/data-channels
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open data-channels example page
|
### Open data-channels example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/t3johb5g/2/)
|
[jsfiddle.net](https://jsfiddle.net/e41tgovp/)
|
||||||
|
|
||||||
### Run data-channels, with your browsers SessionDescription as stdin
|
### Run data-channels, with your browsers SessionDescription as stdin
|
||||||
In the jsfiddle the top textarea is your browser's session description, press `Copy browser SDP to clipboard` or copy the base64 string manually and:
|
In the jsfiddle the top textarea is your browser's session description, press `Copy browser SDP to clipboard` or copy the base64 string manually and:
|
||||||
|
@@ -42,7 +42,7 @@ window.startSession = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ go get github.com/pion/webrtc/v3/examples/insertable-streams
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open insertable-streams example page
|
### Open insertable-streams example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/uqr80Lak/) you should see two text-areas and a 'Start Session' button. You will also have a 'Decrypt' checkbox.
|
[jsfiddle.net](https://jsfiddle.net/t5xoaryc/) you should see two text-areas and a 'Start Session' button. You will also have a 'Decrypt' checkbox.
|
||||||
When unchecked the browser will not decrypt the incoming video stream, so it will stop playing or display certificates.
|
When unchecked the browser will not decrypt the incoming video stream, so it will stop playing or display certificates.
|
||||||
|
|
||||||
### Run insertable-streams with your browsers SessionDescription as stdin
|
### Run insertable-streams with your browsers SessionDescription as stdin
|
||||||
|
@@ -60,7 +60,7 @@ window.startSession = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ go get github.com/pion/webrtc/v3/examples/play-from-disk
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open play-from-disk example page
|
### Open play-from-disk example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/a1cz42op/) you should see two text-areas, 'Start Session' button and 'Copy browser SessionDescription to clipboard'
|
[jsfiddle.net](https://jsfiddle.net/8kup9mvn/) you should see two text-areas, 'Start Session' button and 'Copy browser SessionDescription to clipboard'
|
||||||
|
|
||||||
### Run play-from-disk with your browsers Session Description as stdin
|
### Run play-from-disk with your browsers Session Description as stdin
|
||||||
The `output.ivf` you created should be in the same directory as `play-from-disk`. In the jsfiddle press 'Copy browser Session Description to clipboard' or copy the base64 string manually.
|
The `output.ivf` you created should be in the same directory as `play-from-disk`. In the jsfiddle press 'Copy browser Session Description to clipboard' or copy the base64 string manually.
|
||||||
|
@@ -42,7 +42,7 @@ window.startSession = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ go get github.com/pion/webrtc/v3/examples/reflect
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open reflect example page
|
### Open reflect example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/ogs7muqh/1/) you should see two text-areas and a 'Start Session' button.
|
[jsfiddle.net](https://jsfiddle.net/g643ft1k/) you should see two text-areas and a 'Start Session' button.
|
||||||
|
|
||||||
### Run reflect, with your browsers SessionDescription as stdin
|
### Run reflect, with your browsers SessionDescription as stdin
|
||||||
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
||||||
|
@@ -39,7 +39,7 @@ window.startSession = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@ go get github.com/pion/webrtc/v3/examples/rtcp-processing
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open rtcp-processing example page
|
### Open rtcp-processing example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/Le3zg7sd/) you should see two text-areas, 'Start Session' button and 'Copy browser SessionDescription to clipboard'
|
[jsfiddle.net](https://jsfiddle.net/zurq6j7x/) you should see two text-areas, 'Start Session' button and 'Copy browser SessionDescription to clipboard'
|
||||||
|
|
||||||
### Run rtcp-processing with your browsers Session Description as stdin
|
### Run rtcp-processing with your browsers Session Description as stdin
|
||||||
In the jsfiddle press 'Copy browser Session Description to clipboard' or copy the base64 string manually.
|
In the jsfiddle press 'Copy browser Session Description to clipboard' or copy the base64 string manually.
|
||||||
|
@@ -40,7 +40,7 @@ window.startSession = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ go get github.com/pion/webrtc/v3/examples/rtp-forwarder
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open rtp-forwarder example page
|
### Open rtp-forwarder example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/xjcve6d3/) you should see your Webcam, two text-areas and `Copy browser SDP to clipboard`, `Start Session` buttons
|
[jsfiddle.net](https://jsfiddle.net/fm7btvr3/) you should see your Webcam, two text-areas and `Copy browser SDP to clipboard`, `Start Session` buttons
|
||||||
|
|
||||||
### Run rtp-forwarder, with your browsers SessionDescription as stdin
|
### Run rtp-forwarder, with your browsers SessionDescription as stdin
|
||||||
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
||||||
|
@@ -32,7 +32,7 @@ window.startSession = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@ go get github.com/pion/webrtc/v3/examples/save-to-disk
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open save-to-disk example page
|
### Open save-to-disk example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/xjcve6d3/) you should see your Webcam, two text-areas and two buttons: `Copy browser SDP to clipboard`, `Start Session`.
|
[jsfiddle.net](https://jsfiddle.net/s179hacu/) you should see your Webcam, two text-areas and two buttons: `Copy browser SDP to clipboard`, `Start Session`.
|
||||||
|
|
||||||
### Run save-to-disk, with your browsers SessionDescription as stdin
|
### Run save-to-disk, with your browsers SessionDescription as stdin
|
||||||
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
||||||
|
@@ -33,7 +33,7 @@ window.startSession = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@ go get github.com/pion/webrtc/v3/examples/simulcast
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open simulcast example page
|
### Open simulcast example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/zLebmv41/1/) you should see two text-areas and two buttons: `Copy browser SDP to clipboard`, `Start Session`.
|
[jsfiddle.net](https://jsfiddle.net/tz4d5bhj/) you should see two text-areas and two buttons: `Copy browser SDP to clipboard`, `Start Session`.
|
||||||
|
|
||||||
### Run simulcast, with your browsers SessionDescription as stdin
|
### Run simulcast, with your browsers SessionDescription as stdin
|
||||||
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
||||||
|
@@ -85,7 +85,7 @@ window.startSession = () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('answer', JSON.parse(atob(sd)))
|
console.log('answer', JSON.parse(atob(sd)))
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ go get github.com/pion/webrtc/v3/examples/swap-tracks
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Open swap-tracks example page
|
### Open swap-tracks example page
|
||||||
[jsfiddle.net](https://jsfiddle.net/39w24tr6/1/) you should see two text-areas and two buttons: `Copy browser SDP to clipboard`, `Start Session`.
|
[jsfiddle.net](https://jsfiddle.net/1rx5on86/) you should see two text-areas and two buttons: `Copy browser SDP to clipboard`, `Start Session`.
|
||||||
|
|
||||||
### Run swap-tracks, with your browsers SessionDescription as stdin
|
### Run swap-tracks, with your browsers SessionDescription as stdin
|
||||||
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
|
||||||
|
@@ -68,7 +68,7 @@ window.startSession = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(atob(sd))))
|
pc.setRemoteDescription(JSON.parse(atob(sd)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e)
|
alert(e)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user