File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -178,12 +178,12 @@ export interface MediaAttributes extends SharedAttributes {
178178 // a=maxptime
179179 maxptime ?: number | undefined ;
180180 // a=crypto
181- crypto ?: {
181+ crypto ?: Array < {
182182 id : number ;
183183 suite : string ;
184184 config : string ;
185185 sessionConfig ?: string | undefined ;
186- } | undefined ;
186+ } > | undefined ;
187187 // a=candidate
188188 candidates ?:
189189 | Array < {
Original file line number Diff line number Diff line change @@ -48,3 +48,22 @@ function test_parse_simulcast_stream_list() {
4848 }
4949 }
5050}
51+
52+ function test_crypto_attribute ( ) {
53+ const session : SessionDescription = parse ( "" ) ;
54+ session . media [ 0 ] . crypto = [
55+ {
56+ id : 1 ,
57+ suite : "AES_CM_128_HMAC_SHA1_80" ,
58+ config : "inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|2^31|1:1" ,
59+ sessionConfig : "UNENCRYPTED_SRTP" ,
60+ } ,
61+ ] ;
62+ const sdp : string = write ( session ) ;
63+ const parsed = parse ( sdp ) ;
64+ const crypto = parsed . media [ 0 ] . crypto ! [ 0 ] ;
65+ crypto . id ; // $ExpectType number
66+ crypto . suite ; // $ExpectType string
67+ crypto . config ; // $ExpectType string
68+ crypto . sessionConfig ; // $ExpectType string | undefined
69+ }
You can’t perform that action at this time.
0 commit comments