File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ export interface MediaAttributes extends SharedAttributes {
110110 // a=mid:foo
111111 mid ?: string ;
112112 // a=msid:0c8b064d-d807-43b4-b434-f92a889d8587 98178685-d409-46e0-8e16-7ef0db0db64a
113- msid ?: string ;
113+ msid ?: { id : string ; appdata ?: string } [ ] ;
114114 // a=ptime:20
115115 ptime ?: number ;
116116 // a=maxptime:60
@@ -304,7 +304,7 @@ export interface SharedAttributes {
304304}
305305
306306export interface ParamMap {
307- [ paramName : string ] : number | string ;
307+ [ paramName : string ] : number | string | undefined ;
308308}
309309
310310export function write ( description : SessionDescription ) : string ;
Original file line number Diff line number Diff line change 11{
22 "private" : true ,
33 "name" : " @types/sdp-transform" ,
4- "version" : " 2.15 .9999" ,
4+ "version" : " 3.0 .9999" ,
55 "projects" : [
66 " https://github.com/clux/sdp-transform#readme"
77 ],
Original file line number Diff line number Diff line change @@ -121,3 +121,19 @@ function test_datachannel_media_description() {
121121 const port = parsed . media [ 0 ] . port ;
122122 port ; // $ExpectType number
123123}
124+
125+ function test_msid_attribute ( ) {
126+ const session : SessionDescription = parse ( "" ) ;
127+ session . media [ 0 ] . msid = [
128+ { id : "0c8b064d-d807-43b4-b434-f92a889d8587" } ,
129+ { id : "98178685-d409-46e0-8e16-7ef0db0db64a" , appdata : "my-track-id" } ,
130+ ] ;
131+
132+ const sdp : string = write ( session ) ;
133+ const parsed = parse ( sdp ) ;
134+ const msid = parsed . media [ 0 ] . msid ! ;
135+ msid [ 0 ] . id ; // $ExpectType string
136+ msid [ 0 ] . appdata ; // $ExpectType string | undefined
137+ msid [ 1 ] . id ; // $ExpectType string
138+ msid [ 1 ] . appdata ; // $ExpectType string | undefined
139+ }
You can’t perform that action at this time.
0 commit comments