mirror of
				https://github.com/pion/webrtc.git
				synced 2025-11-01 03:04:06 +08:00 
			
		
		
		
	Remove RTC prefix from all names
Let's pull off the bandaid! * Reduces studdering: webrtc.RTCTrack -> webrtc.Track * Makes it easier to find types by editor autocomplete * Makes code read more fluently (less repetition) Since we're breaking the API in 2.0, our only chance to do this is now. Relates to #408
This commit is contained in:
		| @@ -22,8 +22,8 @@ func main() { | ||||
| 	webrtc.RegisterDefaultCodecs() | ||||
|  | ||||
| 	// Prepare the configuration | ||||
| 	config := webrtc.RTCConfiguration{ | ||||
| 		IceServers: []webrtc.RTCIceServer{ | ||||
| 	config := webrtc.Configuration{ | ||||
| 		ICEServers: []webrtc.ICEServer{ | ||||
| 			{ | ||||
| 				URLs: []string{"stun:stun.l.google.com:19302"}, | ||||
| 			}, | ||||
| @@ -31,7 +31,7 @@ func main() { | ||||
| 	} | ||||
|  | ||||
| 	// Create a new RTCPeerConnection | ||||
| 	peerConnection, err := webrtc.NewRTCPeerConnection(config) | ||||
| 	peerConnection, err := webrtc.NewPeerConnection(config) | ||||
| 	util.Check(err) | ||||
|  | ||||
| 	// Set the handler for ICE connection state | ||||
| @@ -41,19 +41,19 @@ func main() { | ||||
| 	}) | ||||
|  | ||||
| 	// Create a audio track | ||||
| 	opusTrack, err := peerConnection.NewRTCSampleTrack(webrtc.DefaultPayloadTypeOpus, "audio", "pion1") | ||||
| 	opusTrack, err := peerConnection.NewSampleTrack(webrtc.DefaultPayloadTypeOpus, "audio", "pion1") | ||||
| 	util.Check(err) | ||||
| 	_, err = peerConnection.AddTrack(opusTrack) | ||||
| 	util.Check(err) | ||||
|  | ||||
| 	// Create a video track | ||||
| 	vp8Track, err := peerConnection.NewRTCSampleTrack(webrtc.DefaultPayloadTypeVP8, "video", "pion2") | ||||
| 	vp8Track, err := peerConnection.NewSampleTrack(webrtc.DefaultPayloadTypeVP8, "video", "pion2") | ||||
| 	util.Check(err) | ||||
| 	_, err = peerConnection.AddTrack(vp8Track) | ||||
| 	util.Check(err) | ||||
|  | ||||
| 	// Wait for the offer to be pasted | ||||
| 	offer := webrtc.RTCSessionDescription{} | ||||
| 	offer := webrtc.SessionDescription{} | ||||
| 	util.Decode(util.MustReadStdin(), &offer) | ||||
|  | ||||
| 	// Set the remote SessionDescription | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Hawkins
					Max Hawkins