mirror of
https://github.com/pion/webrtc.git
synced 2025-10-04 14:53:05 +08:00
Change the names of event handlers and attributes for readability
This commit is contained in:
@@ -46,7 +46,7 @@ func main() {
|
||||
// Set a handler for when a new remote track starts, this handler saves buffers to disk as
|
||||
// an ivf file, since we could have multiple video tracks we provide a counter.
|
||||
// In your application this is where you would handle/process video
|
||||
peerConnection.Ontrack = func(track *webrtc.RTCTrack) {
|
||||
peerConnection.OnTrack = func(track *webrtc.RTCTrack) {
|
||||
if track.Codec.Name == webrtc.VP8 {
|
||||
fmt.Println("Got VP8 track, saving to disk as output.ivf")
|
||||
i, err := newIVFWriter("output.ivf")
|
||||
@@ -61,7 +61,7 @@ func main() {
|
||||
|
||||
// Set the handler for ICE connection state
|
||||
// This will notify you when the peer has connected/disconnected
|
||||
peerConnection.OnICEConnectionStateChange = func(connectionState ice.ConnectionState) {
|
||||
peerConnection.OnIceConnectionStateChange = func(connectionState ice.ConnectionState) {
|
||||
fmt.Printf("Connection State has changed %s \n", connectionState.String())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user