@@ -28,14 +28,19 @@ public JSError LastMicrophoneError()
2828 return Acquire < JSError > ( ptr ) ;
2929 }
3030
31- public new LocalTrackPublication GetTrack ( TrackSource source )
31+ public new LocalTrackPublication GetTrackPublication ( TrackSource source )
3232 {
33- return base . GetTrack ( source ) as LocalTrackPublication ;
33+ return base . GetTrackPublication ( source ) as LocalTrackPublication ;
3434 }
3535
36- public new LocalTrackPublication GetTrackByName ( string name )
36+ public new LocalTrackPublication GetTrackPublicationByName ( string name )
3737 {
38- return base . GetTrackByName ( name ) as LocalTrackPublication ;
38+ return base . GetTrackPublicationByName ( name ) as LocalTrackPublication ;
39+ }
40+
41+ public new LocalTrackPublication GetTrackPublicationBySid ( string sid )
42+ {
43+ return base . GetTrackPublicationBySid ( sid ) as LocalTrackPublication ;
3944 }
4045
4146 public JSPromise < LocalTrackPublication > SetCameraEnabled ( bool enabled , VideoCaptureOptions ? options = null ,
@@ -153,27 +158,30 @@ public LocalTrackPublication UnpublishTrack(MediaStreamTrack track, bool? stopOn
153158 return Acquire < LocalTrackPublication > ( ptr ) ;
154159 }
155160
156- // TODO Support unsafe ptr
157- public JSPromise PublishData ( byte [ ] data , DataPacketKind kind , params RemoteParticipant [ ] participants )
161+ public JSPromise PublishData ( byte [ ] data , bool reliable , string [ ] destinationIdentities , string topic )
158162 {
159- return PublishData ( data , 0 , data . Length , kind , participants ) ;
163+ return PublishData ( data , 0 , data . Length , reliable , destinationIdentities , topic ) ;
160164 }
161165
162- public JSPromise PublishData ( byte [ ] data , int offset , int size , DataPacketKind kind ,
163- params RemoteParticipant [ ] participants )
166+ public JSPromise PublishData ( byte [ ] data , int offset , int size , bool reliable , string [ ] destinationIdentities , string topic )
164167 {
165- JSArray < RemoteParticipant > arr = null ;
166- if ( participants != null )
167- arr = new JSArray < RemoteParticipant > ( participants ) ;
168+ JSArray < string > arr = null ;
169+ if ( destinationIdentities != null )
170+ arr = new JSArray < string > ( destinationIdentities ) ;
168171
169172 JSNative . PushData ( data , offset , size ) ;
170- JSNative . PushNumber ( ( double ) kind ) ;
173+ JSNative . PushBoolean ( ( bool ) reliable ) ;
171174
172- if ( participants == null )
175+ if ( destinationIdentities == null )
173176 JSNative . PushUndefined ( ) ;
174177 else
175178 JSNative . PushObject ( arr . NativeHandle ) ;
176179
180+ if ( topic == null )
181+ JSNative . PushUndefined ( ) ;
182+ else
183+ JSNative . PushString ( topic ) ;
184+
177185 return Acquire < JSPromise > ( JSNative . CallMethod ( NativeHandle , "publishData" ) ) ;
178186 }
179187
0 commit comments