Skip to content

Commit bf422e0

Browse files
committed
API: Avoid exposing pkg/ice
OnICEConnectionStateChange now return a ICEConnectionState instead of ice.ConnectionState. Resolves #422
1 parent ad647c2 commit bf422e0

File tree

18 files changed

+61
-51
lines changed

18 files changed

+61
-51
lines changed

examples/data-channels-close/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/pions/webrtc"
99
"github.com/pions/webrtc/examples/util"
1010
"github.com/pions/webrtc/pkg/datachannel"
11-
"github.com/pions/webrtc/pkg/ice"
1211
)
1312

1413
func main() {
@@ -32,7 +31,7 @@ func main() {
3231

3332
// Set the handler for ICE connection state
3433
// This will notify you when the peer has connected/disconnected
35-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
34+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
3635
fmt.Printf("ICE Connection State has changed: %s\n", connectionState.String())
3736
})
3837

examples/data-channels-create/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/pions/webrtc"
88
"github.com/pions/webrtc/examples/util"
99
"github.com/pions/webrtc/pkg/datachannel"
10-
"github.com/pions/webrtc/pkg/ice"
1110
)
1211

1312
func main() {
@@ -32,7 +31,7 @@ func main() {
3231

3332
// Set the handler for ICE connection state
3433
// This will notify you when the peer has connected/disconnected
35-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
34+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
3635
fmt.Printf("ICE Connection State has changed: %s\n", connectionState.String())
3736
})
3837

examples/data-channels-detach-create/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/pions/datachannel"
88
"github.com/pions/webrtc"
99
"github.com/pions/webrtc/examples/util"
10-
"github.com/pions/webrtc/pkg/ice"
1110
)
1211

1312
const messageSize = 15
@@ -39,7 +38,7 @@ func main() {
3938

4039
// Set the handler for ICE connection state
4140
// This will notify you when the peer has connected/disconnected
42-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
41+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
4342
fmt.Printf("ICE Connection State has changed: %s\n", connectionState.String())
4443
})
4544

examples/data-channels-detach/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/pions/datachannel"
88
"github.com/pions/webrtc"
99
"github.com/pions/webrtc/examples/util"
10-
"github.com/pions/webrtc/pkg/ice"
1110
)
1211

1312
const messageSize = 15
@@ -35,7 +34,7 @@ func main() {
3534

3635
// Set the handler for ICE connection state
3736
// This will notify you when the peer has connected/disconnected
38-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
37+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
3938
fmt.Printf("ICE Connection State has changed: %s\n", connectionState.String())
4039
})
4140

examples/data-channels/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/pions/webrtc"
88
"github.com/pions/webrtc/examples/util"
99
"github.com/pions/webrtc/pkg/datachannel"
10-
"github.com/pions/webrtc/pkg/ice"
1110
)
1211

1312
func main() {
@@ -28,7 +27,7 @@ func main() {
2827

2928
// Set the handler for ICE connection state
3029
// This will notify you when the peer has connected/disconnected
31-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
30+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
3231
fmt.Printf("ICE Connection State has changed: %s\n", connectionState.String())
3332
})
3433

examples/gstreamer-receive/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/pions/webrtc"
1010
"github.com/pions/webrtc/examples/util"
1111
gst "github.com/pions/webrtc/examples/util/gstreamer-sink"
12-
"github.com/pions/webrtc/pkg/ice"
1312
)
1413

1514
// gstreamerReceiveMain is launched in a goroutine because the main thread is needed
@@ -61,7 +60,7 @@ func gstreamerReceiveMain() {
6160

6261
// Set the handler for ICE connection state
6362
// This will notify you when the peer has connected/disconnected
64-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
63+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
6564
fmt.Printf("Connection State has changed %s \n", connectionState.String())
6665
})
6766

examples/gstreamer-send-offer/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/pions/webrtc"
77
"github.com/pions/webrtc/examples/util"
88
gst "github.com/pions/webrtc/examples/util/gstreamer-src"
9-
"github.com/pions/webrtc/pkg/ice"
109
)
1110

1211
func main() {
@@ -31,7 +30,7 @@ func main() {
3130

3231
// Set the handler for ICE connection state
3332
// This will notify you when the peer has connected/disconnected
34-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
33+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
3534
fmt.Printf("Connection State has changed %s \n", connectionState.String())
3635
})
3736

examples/gstreamer-send/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/pions/webrtc"
88
"github.com/pions/webrtc/examples/util"
99
gst "github.com/pions/webrtc/examples/util/gstreamer-src"
10-
"github.com/pions/webrtc/pkg/ice"
1110
)
1211

1312
func main() {
@@ -36,7 +35,7 @@ func main() {
3635

3736
// Set the handler for ICE connection state
3837
// This will notify you when the peer has connected/disconnected
39-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
38+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
4039
fmt.Printf("Connection State has changed %s \n", connectionState.String())
4140
})
4241

examples/janus-gateway/streaming/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
janus "github.com/notedit/janus-go"
88
"github.com/pions/webrtc"
99
"github.com/pions/webrtc/examples/util"
10-
"github.com/pions/webrtc/pkg/ice"
1110
"github.com/pions/webrtc/pkg/media/ivfwriter"
1211
)
1312

@@ -52,7 +51,7 @@ func main() {
5251
peerConnection, err := webrtc.NewPeerConnection(config)
5352
util.Check(err)
5453

55-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
54+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
5655
fmt.Printf("Connection State has changed %s \n", connectionState.String())
5756
})
5857

examples/janus-gateway/video-room/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/pions/webrtc"
99
"github.com/pions/webrtc/examples/util"
1010
gst "github.com/pions/webrtc/examples/util/gstreamer-src"
11-
"github.com/pions/webrtc/pkg/ice"
1211
)
1312

1413
func watchHandle(handle *janus.Handle) {
@@ -52,7 +51,7 @@ func main() {
5251
peerConnection, err := webrtc.NewPeerConnection(config)
5352
util.Check(err)
5453

55-
peerConnection.OnICEConnectionStateChange(func(connectionState ice.ConnectionState) {
54+
peerConnection.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
5655
fmt.Printf("Connection State has changed %s \n", connectionState.String())
5756
})
5857

0 commit comments

Comments
 (0)