先创建设置: // Prepare the configuration
config := webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
{
URLs: []string{"stun:stu
// TrackLocal is an interface that controls how the user can send media
// The user can provide their own TrackLocal implementations, or use
// the im
peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
{
URLs: []string{"stun:s
之前的几个案例中,ICE过程中SDP的传输都是手工复制粘贴完成的,没有显式指定监听端口的过程,而pion-to-pion就提供了一种自动传输SDP交互的方式。在pion-to-pion里面,pion双方都在固定的端口监听POST请求,SDP信息生成好了之后是用POST传给对方的。 pion-to-p
// Assert that we have an audio or video file
_, err := os.Stat(videoFileName)
haveVideoFile := !os.IsNotExist(err)
_, err = os.Stat(audioFileName)
h