Live video on the AT Protocol
1package media
2
3import (
4 "context"
5 "testing"
6
7 "github.com/pion/webrtc/v4"
8 "github.com/stretchr/testify/require"
9 "go.uber.org/goleak"
10)
11
12func TestWebRTCPlayback2(t *testing.T) {
13 mm, _ := getStaticTestMediaManager(t)
14 ignore := goleak.IgnoreCurrent()
15 defer goleak.VerifyNone(t, ignore)
16 offer := &webrtc.SessionDescription{
17 Type: webrtc.SDPTypeOffer,
18 SDP: firefoxNoH264SDP,
19 }
20 answer, err := mm.WebRTCPlayback2(context.Background(), "test-user", "test-rendition", offer)
21 require.ErrorContains(t, err, "RTPSender created with no codecs")
22 require.Nil(t, answer)
23}
24
25var firefoxNoH264SDP = `v=0
26o=mozilla...THIS_IS_SDPARTA-99.0 2400864153024665403 0 IN IP4 0.0.0.0
27s=-
28t=0 0
29a=sendrecv
30a=fingerprint:sha-256 9A:55:EE:77:40:E7:C9:7F:DB:1A:D4:33:7C:06:9B:07:AE:CE:0F:06:52:1E:DE:5B:8B:A6:65:4C:48:C6:73:15
31a=group:BUNDLE 0 1
32a=ice-options:trickle
33a=msid-semantic:WMS *
34m=video 9 UDP/TLS/RTP/SAVPF 120 124 121 125 99 100 123 122 119
35c=IN IP4 0.0.0.0
36a=candidate:0 1 UDP 2122252543 f2fe908b-a599-4c2b-8e5b-411fb045e57a.local 58949 typ host
37a=candidate:1 1 TCP 2105524479 f2fe908b-a599-4c2b-8e5b-411fb045e57a.local 9 typ host tcptype active
38a=candidate:0 2 UDP 2122252542 f2fe908b-a599-4c2b-8e5b-411fb045e57a.local 52046 typ host
39a=candidate:1 2 TCP 2105524478 f2fe908b-a599-4c2b-8e5b-411fb045e57a.local 9 typ host tcptype active
40a=recvonly
41a=end-of-candidates
42a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
43a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
44a=extmap:5 urn:ietf:params:rtp-hdrext:toffset
45a=extmap:6/recvonly http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
46a=extmap:7 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
47a=extmap-allow-mixed
48a=fmtp:120 max-fs=12288;max-fr=60
49a=fmtp:124 apt=120
50a=fmtp:121 max-fs=12288;max-fr=60
51a=fmtp:125 apt=121
52a=fmtp:100 apt=99
53a=fmtp:119 apt=122
54a=ice-pwd:073b56d923776f7889e9f31dd122eaf5
55a=ice-ufrag:9ba3b1bf
56a=mid:0
57a=rtcp:52046 IN IP4 f2fe908b-a599-4c2b-8e5b-411fb045e57a.local
58a=rtcp-fb:120 nack
59a=rtcp-fb:120 nack pli
60a=rtcp-fb:120 ccm fir
61a=rtcp-fb:120 goog-remb
62a=rtcp-fb:120 transport-cc
63a=rtcp-fb:121 nack
64a=rtcp-fb:121 nack pli
65a=rtcp-fb:121 ccm fir
66a=rtcp-fb:121 goog-remb
67a=rtcp-fb:121 transport-cc
68a=rtcp-fb:99 nack
69a=rtcp-fb:99 nack pli
70a=rtcp-fb:99 ccm fir
71a=rtcp-fb:99 goog-remb
72a=rtcp-fb:99 transport-cc
73a=rtcp-fb:123 nack
74a=rtcp-fb:123 nack pli
75a=rtcp-fb:123 ccm fir
76a=rtcp-fb:123 goog-remb
77a=rtcp-fb:123 transport-cc
78a=rtcp-fb:122 nack
79a=rtcp-fb:122 nack pli
80a=rtcp-fb:122 ccm fir
81a=rtcp-fb:122 goog-remb
82a=rtcp-fb:122 transport-cc
83a=rtcp-mux
84a=rtcp-rsize
85a=rtpmap:120 VP8/90000
86a=rtpmap:124 rtx/90000
87a=rtpmap:121 VP9/90000
88a=rtpmap:125 rtx/90000
89a=rtpmap:99 AV1/90000
90a=rtpmap:100 rtx/90000
91a=rtpmap:123 ulpfec/90000
92a=rtpmap:122 red/90000
93a=rtpmap:119 rtx/90000
94a=setup:actpass
95a=ssrc:3998233880 cname:{d6f4dc1f-0f71-4a23-8ba7-8c95370e5479}
96m=audio 0 UDP/TLS/RTP/SAVPF 109 9 0 8 101
97c=IN IP4 0.0.0.0
98a=bundle-only
99a=recvonly
100a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
101a=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level
102a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
103a=extmap-allow-mixed
104a=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1
105a=fmtp:101 0-15
106a=ice-pwd:073b56d923776f7889e9f31dd122eaf5
107a=ice-ufrag:9ba3b1bf
108a=mid:1
109a=rtcp-mux
110a=rtpmap:109 opus/48000/2
111a=rtpmap:9 G722/8000/1
112a=rtpmap:0 PCMU/8000
113a=rtpmap:8 PCMA/8000
114a=rtpmap:101 telephone-event/8000
115a=setup:actpass
116a=ssrc:543748180 cname:{d6f4dc1f-0f71-4a23-8ba7-8c95370e5479}
117`