MCPcopy Index your code
hub / github.com/TensorWorks/Unreal-PixelStreaming-RTP-Bridge / createOffer

Function createOffer

main.go:78–97  ·  view source on GitHub ↗
(peerConnection *webrtc.PeerConnection)

Source from the content-addressed store, hash-verified

76}
77
78func createOffer(peerConnection *webrtc.PeerConnection) (string, error) {
79 offer, err := peerConnection.CreateOffer(nil)
80 if err != nil {
81 log.Println("Error creating peer connection offer: ", err)
82 return "", err
83 }
84
85 if err = peerConnection.SetLocalDescription(offer); err != nil {
86 log.Println("Error setting local description of peer connection: ", err)
87 return "", err
88 }
89
90 offerStringBytes, err := json.Marshal(offer)
91 if err != nil {
92 log.Println("Error unmarshalling json from offer object: ", err)
93 return "", err
94 }
95 offerString := string(offerStringBytes)
96 return offerString, err
97}
98
99func createPeerConnection() (*webrtc.PeerConnection, error) {
100 // Create a MediaEngine object to configure the supported codec

Callers 1

sendOfferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected