github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis49_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package web 5 6 import ( 7 "github.com/primecitizens/pcz/std/ffi/js" 8 "github.com/primecitizens/pcz/std/plat/js/web/bindings" 9 ) 10 11 type RTCRtpEncodingParameters struct { 12 // Active is "RTCRtpEncodingParameters.active" 13 // 14 // Optional, defaults to true. 15 // 16 // NOTE: FFI_USE_Active MUST be set to true to make this field effective. 17 Active bool 18 // MaxBitrate is "RTCRtpEncodingParameters.maxBitrate" 19 // 20 // Optional 21 // 22 // NOTE: FFI_USE_MaxBitrate MUST be set to true to make this field effective. 23 MaxBitrate uint32 24 // MaxFramerate is "RTCRtpEncodingParameters.maxFramerate" 25 // 26 // Optional 27 // 28 // NOTE: FFI_USE_MaxFramerate MUST be set to true to make this field effective. 29 MaxFramerate float64 30 // ScaleResolutionDownBy is "RTCRtpEncodingParameters.scaleResolutionDownBy" 31 // 32 // Optional 33 // 34 // NOTE: FFI_USE_ScaleResolutionDownBy MUST be set to true to make this field effective. 35 ScaleResolutionDownBy float64 36 // Rid is "RTCRtpEncodingParameters.rid" 37 // 38 // Optional 39 Rid js.String 40 // Priority is "RTCRtpEncodingParameters.priority" 41 // 42 // Optional, defaults to "low". 43 Priority RTCPriorityType 44 // NetworkPriority is "RTCRtpEncodingParameters.networkPriority" 45 // 46 // Optional 47 NetworkPriority RTCPriorityType 48 // ScalabilityMode is "RTCRtpEncodingParameters.scalabilityMode" 49 // 50 // Optional 51 ScalabilityMode js.String 52 53 FFI_USE_Active bool // for Active. 54 FFI_USE_MaxBitrate bool // for MaxBitrate. 55 FFI_USE_MaxFramerate bool // for MaxFramerate. 56 FFI_USE_ScaleResolutionDownBy bool // for ScaleResolutionDownBy. 57 58 FFI_USE bool 59 } 60 61 // FromRef calls UpdateFrom and returns a RTCRtpEncodingParameters with all fields set. 62 func (p RTCRtpEncodingParameters) FromRef(ref js.Ref) RTCRtpEncodingParameters { 63 p.UpdateFrom(ref) 64 return p 65 } 66 67 // New creates a new RTCRtpEncodingParameters in the application heap. 68 func (p RTCRtpEncodingParameters) New() js.Ref { 69 return bindings.RTCRtpEncodingParametersJSLoad( 70 js.Pointer(&p), js.True, 0, 71 ) 72 } 73 74 // UpdateFrom copies value of all fields of the heap object to p. 75 func (p *RTCRtpEncodingParameters) UpdateFrom(ref js.Ref) { 76 bindings.RTCRtpEncodingParametersJSStore( 77 js.Pointer(p), ref, 78 ) 79 } 80 81 // Update writes all fields of the p to the heap object referenced by ref. 82 func (p *RTCRtpEncodingParameters) Update(ref js.Ref) { 83 bindings.RTCRtpEncodingParametersJSLoad( 84 js.Pointer(p), js.False, ref, 85 ) 86 } 87 88 // FreeMembers frees fields with heap reference, if recursive is true 89 // free all heap references reachable from p. 90 func (p *RTCRtpEncodingParameters) FreeMembers(recursive bool) { 91 js.Free( 92 p.Rid.Ref(), 93 p.ScalabilityMode.Ref(), 94 ) 95 p.Rid = p.Rid.FromRef(js.Undefined) 96 p.ScalabilityMode = p.ScalabilityMode.FromRef(js.Undefined) 97 } 98 99 type RTCRtpHeaderExtensionParameters struct { 100 // Uri is "RTCRtpHeaderExtensionParameters.uri" 101 // 102 // Required 103 Uri js.String 104 // Id is "RTCRtpHeaderExtensionParameters.id" 105 // 106 // Required 107 Id uint16 108 // Encrypted is "RTCRtpHeaderExtensionParameters.encrypted" 109 // 110 // Optional, defaults to false. 111 // 112 // NOTE: FFI_USE_Encrypted MUST be set to true to make this field effective. 113 Encrypted bool 114 115 FFI_USE_Encrypted bool // for Encrypted. 116 117 FFI_USE bool 118 } 119 120 // FromRef calls UpdateFrom and returns a RTCRtpHeaderExtensionParameters with all fields set. 121 func (p RTCRtpHeaderExtensionParameters) FromRef(ref js.Ref) RTCRtpHeaderExtensionParameters { 122 p.UpdateFrom(ref) 123 return p 124 } 125 126 // New creates a new RTCRtpHeaderExtensionParameters in the application heap. 127 func (p RTCRtpHeaderExtensionParameters) New() js.Ref { 128 return bindings.RTCRtpHeaderExtensionParametersJSLoad( 129 js.Pointer(&p), js.True, 0, 130 ) 131 } 132 133 // UpdateFrom copies value of all fields of the heap object to p. 134 func (p *RTCRtpHeaderExtensionParameters) UpdateFrom(ref js.Ref) { 135 bindings.RTCRtpHeaderExtensionParametersJSStore( 136 js.Pointer(p), ref, 137 ) 138 } 139 140 // Update writes all fields of the p to the heap object referenced by ref. 141 func (p *RTCRtpHeaderExtensionParameters) Update(ref js.Ref) { 142 bindings.RTCRtpHeaderExtensionParametersJSLoad( 143 js.Pointer(p), js.False, ref, 144 ) 145 } 146 147 // FreeMembers frees fields with heap reference, if recursive is true 148 // free all heap references reachable from p. 149 func (p *RTCRtpHeaderExtensionParameters) FreeMembers(recursive bool) { 150 js.Free( 151 p.Uri.Ref(), 152 ) 153 p.Uri = p.Uri.FromRef(js.Undefined) 154 } 155 156 type RTCRtcpParameters struct { 157 // Cname is "RTCRtcpParameters.cname" 158 // 159 // Optional 160 Cname js.String 161 // ReducedSize is "RTCRtcpParameters.reducedSize" 162 // 163 // Optional 164 // 165 // NOTE: FFI_USE_ReducedSize MUST be set to true to make this field effective. 166 ReducedSize bool 167 168 FFI_USE_ReducedSize bool // for ReducedSize. 169 170 FFI_USE bool 171 } 172 173 // FromRef calls UpdateFrom and returns a RTCRtcpParameters with all fields set. 174 func (p RTCRtcpParameters) FromRef(ref js.Ref) RTCRtcpParameters { 175 p.UpdateFrom(ref) 176 return p 177 } 178 179 // New creates a new RTCRtcpParameters in the application heap. 180 func (p RTCRtcpParameters) New() js.Ref { 181 return bindings.RTCRtcpParametersJSLoad( 182 js.Pointer(&p), js.True, 0, 183 ) 184 } 185 186 // UpdateFrom copies value of all fields of the heap object to p. 187 func (p *RTCRtcpParameters) UpdateFrom(ref js.Ref) { 188 bindings.RTCRtcpParametersJSStore( 189 js.Pointer(p), ref, 190 ) 191 } 192 193 // Update writes all fields of the p to the heap object referenced by ref. 194 func (p *RTCRtcpParameters) Update(ref js.Ref) { 195 bindings.RTCRtcpParametersJSLoad( 196 js.Pointer(p), js.False, ref, 197 ) 198 } 199 200 // FreeMembers frees fields with heap reference, if recursive is true 201 // free all heap references reachable from p. 202 func (p *RTCRtcpParameters) FreeMembers(recursive bool) { 203 js.Free( 204 p.Cname.Ref(), 205 ) 206 p.Cname = p.Cname.FromRef(js.Undefined) 207 } 208 209 type RTCRtpCodecParameters struct { 210 // PayloadType is "RTCRtpCodecParameters.payloadType" 211 // 212 // Required 213 PayloadType uint8 214 // MimeType is "RTCRtpCodecParameters.mimeType" 215 // 216 // Required 217 MimeType js.String 218 // ClockRate is "RTCRtpCodecParameters.clockRate" 219 // 220 // Required 221 ClockRate uint32 222 // Channels is "RTCRtpCodecParameters.channels" 223 // 224 // Optional 225 // 226 // NOTE: FFI_USE_Channels MUST be set to true to make this field effective. 227 Channels uint16 228 // SdpFmtpLine is "RTCRtpCodecParameters.sdpFmtpLine" 229 // 230 // Optional 231 SdpFmtpLine js.String 232 233 FFI_USE_Channels bool // for Channels. 234 235 FFI_USE bool 236 } 237 238 // FromRef calls UpdateFrom and returns a RTCRtpCodecParameters with all fields set. 239 func (p RTCRtpCodecParameters) FromRef(ref js.Ref) RTCRtpCodecParameters { 240 p.UpdateFrom(ref) 241 return p 242 } 243 244 // New creates a new RTCRtpCodecParameters in the application heap. 245 func (p RTCRtpCodecParameters) New() js.Ref { 246 return bindings.RTCRtpCodecParametersJSLoad( 247 js.Pointer(&p), js.True, 0, 248 ) 249 } 250 251 // UpdateFrom copies value of all fields of the heap object to p. 252 func (p *RTCRtpCodecParameters) UpdateFrom(ref js.Ref) { 253 bindings.RTCRtpCodecParametersJSStore( 254 js.Pointer(p), ref, 255 ) 256 } 257 258 // Update writes all fields of the p to the heap object referenced by ref. 259 func (p *RTCRtpCodecParameters) Update(ref js.Ref) { 260 bindings.RTCRtpCodecParametersJSLoad( 261 js.Pointer(p), js.False, ref, 262 ) 263 } 264 265 // FreeMembers frees fields with heap reference, if recursive is true 266 // free all heap references reachable from p. 267 func (p *RTCRtpCodecParameters) FreeMembers(recursive bool) { 268 js.Free( 269 p.MimeType.Ref(), 270 p.SdpFmtpLine.Ref(), 271 ) 272 p.MimeType = p.MimeType.FromRef(js.Undefined) 273 p.SdpFmtpLine = p.SdpFmtpLine.FromRef(js.Undefined) 274 } 275 276 type RTCRtpSendParameters struct { 277 // TransactionId is "RTCRtpSendParameters.transactionId" 278 // 279 // Required 280 TransactionId js.String 281 // Encodings is "RTCRtpSendParameters.encodings" 282 // 283 // Required 284 Encodings js.Array[RTCRtpEncodingParameters] 285 // HeaderExtensions is "RTCRtpSendParameters.headerExtensions" 286 // 287 // Required 288 HeaderExtensions js.Array[RTCRtpHeaderExtensionParameters] 289 // Rtcp is "RTCRtpSendParameters.rtcp" 290 // 291 // Required 292 // 293 // NOTE: Rtcp.FFI_USE MUST be set to true to get Rtcp used. 294 Rtcp RTCRtcpParameters 295 // Codecs is "RTCRtpSendParameters.codecs" 296 // 297 // Required 298 Codecs js.Array[RTCRtpCodecParameters] 299 // DegradationPreference is "RTCRtpSendParameters.degradationPreference" 300 // 301 // Optional 302 DegradationPreference RTCDegradationPreference 303 304 FFI_USE bool 305 } 306 307 // FromRef calls UpdateFrom and returns a RTCRtpSendParameters with all fields set. 308 func (p RTCRtpSendParameters) FromRef(ref js.Ref) RTCRtpSendParameters { 309 p.UpdateFrom(ref) 310 return p 311 } 312 313 // New creates a new RTCRtpSendParameters in the application heap. 314 func (p RTCRtpSendParameters) New() js.Ref { 315 return bindings.RTCRtpSendParametersJSLoad( 316 js.Pointer(&p), js.True, 0, 317 ) 318 } 319 320 // UpdateFrom copies value of all fields of the heap object to p. 321 func (p *RTCRtpSendParameters) UpdateFrom(ref js.Ref) { 322 bindings.RTCRtpSendParametersJSStore( 323 js.Pointer(p), ref, 324 ) 325 } 326 327 // Update writes all fields of the p to the heap object referenced by ref. 328 func (p *RTCRtpSendParameters) Update(ref js.Ref) { 329 bindings.RTCRtpSendParametersJSLoad( 330 js.Pointer(p), js.False, ref, 331 ) 332 } 333 334 // FreeMembers frees fields with heap reference, if recursive is true 335 // free all heap references reachable from p. 336 func (p *RTCRtpSendParameters) FreeMembers(recursive bool) { 337 js.Free( 338 p.TransactionId.Ref(), 339 p.Encodings.Ref(), 340 p.HeaderExtensions.Ref(), 341 p.Codecs.Ref(), 342 ) 343 p.TransactionId = p.TransactionId.FromRef(js.Undefined) 344 p.Encodings = p.Encodings.FromRef(js.Undefined) 345 p.HeaderExtensions = p.HeaderExtensions.FromRef(js.Undefined) 346 p.Codecs = p.Codecs.FromRef(js.Undefined) 347 if recursive { 348 p.Rtcp.FreeMembers(true) 349 } 350 } 351 352 type RTCSetParameterOptions struct { 353 FFI_USE bool 354 } 355 356 // FromRef calls UpdateFrom and returns a RTCSetParameterOptions with all fields set. 357 func (p RTCSetParameterOptions) FromRef(ref js.Ref) RTCSetParameterOptions { 358 p.UpdateFrom(ref) 359 return p 360 } 361 362 // New creates a new RTCSetParameterOptions in the application heap. 363 func (p RTCSetParameterOptions) New() js.Ref { 364 return bindings.RTCSetParameterOptionsJSLoad( 365 js.Pointer(&p), js.True, 0, 366 ) 367 } 368 369 // UpdateFrom copies value of all fields of the heap object to p. 370 func (p *RTCSetParameterOptions) UpdateFrom(ref js.Ref) { 371 bindings.RTCSetParameterOptionsJSStore( 372 js.Pointer(p), ref, 373 ) 374 } 375 376 // Update writes all fields of the p to the heap object referenced by ref. 377 func (p *RTCSetParameterOptions) Update(ref js.Ref) { 378 bindings.RTCSetParameterOptionsJSLoad( 379 js.Pointer(p), js.False, ref, 380 ) 381 } 382 383 // FreeMembers frees fields with heap reference, if recursive is true 384 // free all heap references reachable from p. 385 func (p *RTCSetParameterOptions) FreeMembers(recursive bool) { 386 } 387 388 type RTCStatsReport struct { 389 ref js.Ref 390 } 391 392 func (this RTCStatsReport) Once() RTCStatsReport { 393 this.ref.Once() 394 return this 395 } 396 397 func (this RTCStatsReport) Ref() js.Ref { 398 return this.ref 399 } 400 401 func (this RTCStatsReport) FromRef(ref js.Ref) RTCStatsReport { 402 this.ref = ref 403 return this 404 } 405 406 func (this RTCStatsReport) Free() { 407 this.ref.Free() 408 } 409 410 type SFrameTransformRole uint32 411 412 const ( 413 _ SFrameTransformRole = iota 414 415 SFrameTransformRole_ENCRYPT 416 SFrameTransformRole_DECRYPT 417 ) 418 419 func (SFrameTransformRole) FromRef(str js.Ref) SFrameTransformRole { 420 return SFrameTransformRole(bindings.ConstOfSFrameTransformRole(str)) 421 } 422 423 func (x SFrameTransformRole) String() (string, bool) { 424 switch x { 425 case SFrameTransformRole_ENCRYPT: 426 return "encrypt", true 427 case SFrameTransformRole_DECRYPT: 428 return "decrypt", true 429 default: 430 return "", false 431 } 432 } 433 434 type SFrameTransformOptions struct { 435 // Role is "SFrameTransformOptions.role" 436 // 437 // Optional, defaults to "encrypt". 438 Role SFrameTransformRole 439 440 FFI_USE bool 441 } 442 443 // FromRef calls UpdateFrom and returns a SFrameTransformOptions with all fields set. 444 func (p SFrameTransformOptions) FromRef(ref js.Ref) SFrameTransformOptions { 445 p.UpdateFrom(ref) 446 return p 447 } 448 449 // New creates a new SFrameTransformOptions in the application heap. 450 func (p SFrameTransformOptions) New() js.Ref { 451 return bindings.SFrameTransformOptionsJSLoad( 452 js.Pointer(&p), js.True, 0, 453 ) 454 } 455 456 // UpdateFrom copies value of all fields of the heap object to p. 457 func (p *SFrameTransformOptions) UpdateFrom(ref js.Ref) { 458 bindings.SFrameTransformOptionsJSStore( 459 js.Pointer(p), ref, 460 ) 461 } 462 463 // Update writes all fields of the p to the heap object referenced by ref. 464 func (p *SFrameTransformOptions) Update(ref js.Ref) { 465 bindings.SFrameTransformOptionsJSLoad( 466 js.Pointer(p), js.False, ref, 467 ) 468 } 469 470 // FreeMembers frees fields with heap reference, if recursive is true 471 // free all heap references reachable from p. 472 func (p *SFrameTransformOptions) FreeMembers(recursive bool) { 473 } 474 475 func NewSFrameTransform(options SFrameTransformOptions) (ret SFrameTransform) { 476 ret.ref = bindings.NewSFrameTransformBySFrameTransform( 477 js.Pointer(&options)) 478 return 479 } 480 481 func NewSFrameTransformBySFrameTransform1() (ret SFrameTransform) { 482 ret.ref = bindings.NewSFrameTransformBySFrameTransform1() 483 return 484 } 485 486 type SFrameTransform struct { 487 EventTarget 488 } 489 490 func (this SFrameTransform) Once() SFrameTransform { 491 this.ref.Once() 492 return this 493 } 494 495 func (this SFrameTransform) Ref() js.Ref { 496 return this.EventTarget.Ref() 497 } 498 499 func (this SFrameTransform) FromRef(ref js.Ref) SFrameTransform { 500 this.EventTarget = this.EventTarget.FromRef(ref) 501 return this 502 } 503 504 func (this SFrameTransform) Free() { 505 this.ref.Free() 506 } 507 508 // Readable returns the value of property "SFrameTransform.readable". 509 // 510 // It returns ok=false if there is no such property. 511 func (this SFrameTransform) Readable() (ret ReadableStream, ok bool) { 512 ok = js.True == bindings.GetSFrameTransformReadable( 513 this.ref, js.Pointer(&ret), 514 ) 515 return 516 } 517 518 // Writable returns the value of property "SFrameTransform.writable". 519 // 520 // It returns ok=false if there is no such property. 521 func (this SFrameTransform) Writable() (ret WritableStream, ok bool) { 522 ok = js.True == bindings.GetSFrameTransformWritable( 523 this.ref, js.Pointer(&ret), 524 ) 525 return 526 } 527 528 // HasFuncSetEncryptionKey returns true if the method "SFrameTransform.setEncryptionKey" exists. 529 func (this SFrameTransform) HasFuncSetEncryptionKey() bool { 530 return js.True == bindings.HasFuncSFrameTransformSetEncryptionKey( 531 this.ref, 532 ) 533 } 534 535 // FuncSetEncryptionKey returns the method "SFrameTransform.setEncryptionKey". 536 func (this SFrameTransform) FuncSetEncryptionKey() (fn js.Func[func(key CryptoKey, keyID CryptoKeyID) js.Promise[js.Void]]) { 537 bindings.FuncSFrameTransformSetEncryptionKey( 538 this.ref, js.Pointer(&fn), 539 ) 540 return 541 } 542 543 // SetEncryptionKey calls the method "SFrameTransform.setEncryptionKey". 544 func (this SFrameTransform) SetEncryptionKey(key CryptoKey, keyID CryptoKeyID) (ret js.Promise[js.Void]) { 545 bindings.CallSFrameTransformSetEncryptionKey( 546 this.ref, js.Pointer(&ret), 547 key.Ref(), 548 keyID.Ref(), 549 ) 550 551 return 552 } 553 554 // TrySetEncryptionKey calls the method "SFrameTransform.setEncryptionKey" 555 // in a try/catch block and returns (_, err, ok = false) when it went through 556 // the catch clause. 557 func (this SFrameTransform) TrySetEncryptionKey(key CryptoKey, keyID CryptoKeyID) (ret js.Promise[js.Void], exception js.Any, ok bool) { 558 ok = js.True == bindings.TrySFrameTransformSetEncryptionKey( 559 this.ref, js.Pointer(&ret), js.Pointer(&exception), 560 key.Ref(), 561 keyID.Ref(), 562 ) 563 564 return 565 } 566 567 // HasFuncSetEncryptionKey1 returns true if the method "SFrameTransform.setEncryptionKey" exists. 568 func (this SFrameTransform) HasFuncSetEncryptionKey1() bool { 569 return js.True == bindings.HasFuncSFrameTransformSetEncryptionKey1( 570 this.ref, 571 ) 572 } 573 574 // FuncSetEncryptionKey1 returns the method "SFrameTransform.setEncryptionKey". 575 func (this SFrameTransform) FuncSetEncryptionKey1() (fn js.Func[func(key CryptoKey) js.Promise[js.Void]]) { 576 bindings.FuncSFrameTransformSetEncryptionKey1( 577 this.ref, js.Pointer(&fn), 578 ) 579 return 580 } 581 582 // SetEncryptionKey1 calls the method "SFrameTransform.setEncryptionKey". 583 func (this SFrameTransform) SetEncryptionKey1(key CryptoKey) (ret js.Promise[js.Void]) { 584 bindings.CallSFrameTransformSetEncryptionKey1( 585 this.ref, js.Pointer(&ret), 586 key.Ref(), 587 ) 588 589 return 590 } 591 592 // TrySetEncryptionKey1 calls the method "SFrameTransform.setEncryptionKey" 593 // in a try/catch block and returns (_, err, ok = false) when it went through 594 // the catch clause. 595 func (this SFrameTransform) TrySetEncryptionKey1(key CryptoKey) (ret js.Promise[js.Void], exception js.Any, ok bool) { 596 ok = js.True == bindings.TrySFrameTransformSetEncryptionKey1( 597 this.ref, js.Pointer(&ret), js.Pointer(&exception), 598 key.Ref(), 599 ) 600 601 return 602 } 603 604 type WorkerOptions struct { 605 // Type is "WorkerOptions.type" 606 // 607 // Optional, defaults to "classic". 608 Type WorkerType 609 // Credentials is "WorkerOptions.credentials" 610 // 611 // Optional, defaults to "same-origin". 612 Credentials RequestCredentials 613 // Name is "WorkerOptions.name" 614 // 615 // Optional, defaults to "". 616 Name js.String 617 618 FFI_USE bool 619 } 620 621 // FromRef calls UpdateFrom and returns a WorkerOptions with all fields set. 622 func (p WorkerOptions) FromRef(ref js.Ref) WorkerOptions { 623 p.UpdateFrom(ref) 624 return p 625 } 626 627 // New creates a new WorkerOptions in the application heap. 628 func (p WorkerOptions) New() js.Ref { 629 return bindings.WorkerOptionsJSLoad( 630 js.Pointer(&p), js.True, 0, 631 ) 632 } 633 634 // UpdateFrom copies value of all fields of the heap object to p. 635 func (p *WorkerOptions) UpdateFrom(ref js.Ref) { 636 bindings.WorkerOptionsJSStore( 637 js.Pointer(p), ref, 638 ) 639 } 640 641 // Update writes all fields of the p to the heap object referenced by ref. 642 func (p *WorkerOptions) Update(ref js.Ref) { 643 bindings.WorkerOptionsJSLoad( 644 js.Pointer(p), js.False, ref, 645 ) 646 } 647 648 // FreeMembers frees fields with heap reference, if recursive is true 649 // free all heap references reachable from p. 650 func (p *WorkerOptions) FreeMembers(recursive bool) { 651 js.Free( 652 p.Name.Ref(), 653 ) 654 p.Name = p.Name.FromRef(js.Undefined) 655 } 656 657 func NewWorker(scriptURL js.String, options WorkerOptions) (ret Worker) { 658 ret.ref = bindings.NewWorkerByWorker( 659 scriptURL.Ref(), 660 js.Pointer(&options)) 661 return 662 } 663 664 func NewWorkerByWorker1(scriptURL js.String) (ret Worker) { 665 ret.ref = bindings.NewWorkerByWorker1( 666 scriptURL.Ref()) 667 return 668 } 669 670 type Worker struct { 671 EventTarget 672 } 673 674 func (this Worker) Once() Worker { 675 this.ref.Once() 676 return this 677 } 678 679 func (this Worker) Ref() js.Ref { 680 return this.EventTarget.Ref() 681 } 682 683 func (this Worker) FromRef(ref js.Ref) Worker { 684 this.EventTarget = this.EventTarget.FromRef(ref) 685 return this 686 } 687 688 func (this Worker) Free() { 689 this.ref.Free() 690 } 691 692 // HasFuncTerminate returns true if the method "Worker.terminate" exists. 693 func (this Worker) HasFuncTerminate() bool { 694 return js.True == bindings.HasFuncWorkerTerminate( 695 this.ref, 696 ) 697 } 698 699 // FuncTerminate returns the method "Worker.terminate". 700 func (this Worker) FuncTerminate() (fn js.Func[func()]) { 701 bindings.FuncWorkerTerminate( 702 this.ref, js.Pointer(&fn), 703 ) 704 return 705 } 706 707 // Terminate calls the method "Worker.terminate". 708 func (this Worker) Terminate() (ret js.Void) { 709 bindings.CallWorkerTerminate( 710 this.ref, js.Pointer(&ret), 711 ) 712 713 return 714 } 715 716 // TryTerminate calls the method "Worker.terminate" 717 // in a try/catch block and returns (_, err, ok = false) when it went through 718 // the catch clause. 719 func (this Worker) TryTerminate() (ret js.Void, exception js.Any, ok bool) { 720 ok = js.True == bindings.TryWorkerTerminate( 721 this.ref, js.Pointer(&ret), js.Pointer(&exception), 722 ) 723 724 return 725 } 726 727 // HasFuncPostMessage returns true if the method "Worker.postMessage" exists. 728 func (this Worker) HasFuncPostMessage() bool { 729 return js.True == bindings.HasFuncWorkerPostMessage( 730 this.ref, 731 ) 732 } 733 734 // FuncPostMessage returns the method "Worker.postMessage". 735 func (this Worker) FuncPostMessage() (fn js.Func[func(message js.Any, transfer js.Array[js.Object])]) { 736 bindings.FuncWorkerPostMessage( 737 this.ref, js.Pointer(&fn), 738 ) 739 return 740 } 741 742 // PostMessage calls the method "Worker.postMessage". 743 func (this Worker) PostMessage(message js.Any, transfer js.Array[js.Object]) (ret js.Void) { 744 bindings.CallWorkerPostMessage( 745 this.ref, js.Pointer(&ret), 746 message.Ref(), 747 transfer.Ref(), 748 ) 749 750 return 751 } 752 753 // TryPostMessage calls the method "Worker.postMessage" 754 // in a try/catch block and returns (_, err, ok = false) when it went through 755 // the catch clause. 756 func (this Worker) TryPostMessage(message js.Any, transfer js.Array[js.Object]) (ret js.Void, exception js.Any, ok bool) { 757 ok = js.True == bindings.TryWorkerPostMessage( 758 this.ref, js.Pointer(&ret), js.Pointer(&exception), 759 message.Ref(), 760 transfer.Ref(), 761 ) 762 763 return 764 } 765 766 // HasFuncPostMessage1 returns true if the method "Worker.postMessage" exists. 767 func (this Worker) HasFuncPostMessage1() bool { 768 return js.True == bindings.HasFuncWorkerPostMessage1( 769 this.ref, 770 ) 771 } 772 773 // FuncPostMessage1 returns the method "Worker.postMessage". 774 func (this Worker) FuncPostMessage1() (fn js.Func[func(message js.Any, options StructuredSerializeOptions)]) { 775 bindings.FuncWorkerPostMessage1( 776 this.ref, js.Pointer(&fn), 777 ) 778 return 779 } 780 781 // PostMessage1 calls the method "Worker.postMessage". 782 func (this Worker) PostMessage1(message js.Any, options StructuredSerializeOptions) (ret js.Void) { 783 bindings.CallWorkerPostMessage1( 784 this.ref, js.Pointer(&ret), 785 message.Ref(), 786 js.Pointer(&options), 787 ) 788 789 return 790 } 791 792 // TryPostMessage1 calls the method "Worker.postMessage" 793 // in a try/catch block and returns (_, err, ok = false) when it went through 794 // the catch clause. 795 func (this Worker) TryPostMessage1(message js.Any, options StructuredSerializeOptions) (ret js.Void, exception js.Any, ok bool) { 796 ok = js.True == bindings.TryWorkerPostMessage1( 797 this.ref, js.Pointer(&ret), js.Pointer(&exception), 798 message.Ref(), 799 js.Pointer(&options), 800 ) 801 802 return 803 } 804 805 // HasFuncPostMessage2 returns true if the method "Worker.postMessage" exists. 806 func (this Worker) HasFuncPostMessage2() bool { 807 return js.True == bindings.HasFuncWorkerPostMessage2( 808 this.ref, 809 ) 810 } 811 812 // FuncPostMessage2 returns the method "Worker.postMessage". 813 func (this Worker) FuncPostMessage2() (fn js.Func[func(message js.Any)]) { 814 bindings.FuncWorkerPostMessage2( 815 this.ref, js.Pointer(&fn), 816 ) 817 return 818 } 819 820 // PostMessage2 calls the method "Worker.postMessage". 821 func (this Worker) PostMessage2(message js.Any) (ret js.Void) { 822 bindings.CallWorkerPostMessage2( 823 this.ref, js.Pointer(&ret), 824 message.Ref(), 825 ) 826 827 return 828 } 829 830 // TryPostMessage2 calls the method "Worker.postMessage" 831 // in a try/catch block and returns (_, err, ok = false) when it went through 832 // the catch clause. 833 func (this Worker) TryPostMessage2(message js.Any) (ret js.Void, exception js.Any, ok bool) { 834 ok = js.True == bindings.TryWorkerPostMessage2( 835 this.ref, js.Pointer(&ret), js.Pointer(&exception), 836 message.Ref(), 837 ) 838 839 return 840 } 841 842 func NewRTCRtpScriptTransform(worker Worker, options js.Any, transfer js.Array[js.Object]) (ret RTCRtpScriptTransform) { 843 ret.ref = bindings.NewRTCRtpScriptTransformByRTCRtpScriptTransform( 844 worker.Ref(), 845 options.Ref(), 846 transfer.Ref()) 847 return 848 } 849 850 func NewRTCRtpScriptTransformByRTCRtpScriptTransform1(worker Worker, options js.Any) (ret RTCRtpScriptTransform) { 851 ret.ref = bindings.NewRTCRtpScriptTransformByRTCRtpScriptTransform1( 852 worker.Ref(), 853 options.Ref()) 854 return 855 } 856 857 func NewRTCRtpScriptTransformByRTCRtpScriptTransform2(worker Worker) (ret RTCRtpScriptTransform) { 858 ret.ref = bindings.NewRTCRtpScriptTransformByRTCRtpScriptTransform2( 859 worker.Ref()) 860 return 861 } 862 863 type RTCRtpScriptTransform struct { 864 ref js.Ref 865 } 866 867 func (this RTCRtpScriptTransform) Once() RTCRtpScriptTransform { 868 this.ref.Once() 869 return this 870 } 871 872 func (this RTCRtpScriptTransform) Ref() js.Ref { 873 return this.ref 874 } 875 876 func (this RTCRtpScriptTransform) FromRef(ref js.Ref) RTCRtpScriptTransform { 877 this.ref = ref 878 return this 879 } 880 881 func (this RTCRtpScriptTransform) Free() { 882 this.ref.Free() 883 } 884 885 type OneOf_SFrameTransform_RTCRtpScriptTransform struct { 886 ref js.Ref 887 } 888 889 func (x OneOf_SFrameTransform_RTCRtpScriptTransform) Ref() js.Ref { 890 return x.ref 891 } 892 893 func (x OneOf_SFrameTransform_RTCRtpScriptTransform) Free() { 894 x.ref.Free() 895 } 896 897 func (x OneOf_SFrameTransform_RTCRtpScriptTransform) FromRef(ref js.Ref) OneOf_SFrameTransform_RTCRtpScriptTransform { 898 return OneOf_SFrameTransform_RTCRtpScriptTransform{ 899 ref: ref, 900 } 901 } 902 903 func (x OneOf_SFrameTransform_RTCRtpScriptTransform) SFrameTransform() SFrameTransform { 904 return SFrameTransform{}.FromRef(x.ref) 905 } 906 907 func (x OneOf_SFrameTransform_RTCRtpScriptTransform) RTCRtpScriptTransform() RTCRtpScriptTransform { 908 return RTCRtpScriptTransform{}.FromRef(x.ref) 909 } 910 911 type RTCRtpTransform = OneOf_SFrameTransform_RTCRtpScriptTransform 912 913 type RTCRtpSender struct { 914 ref js.Ref 915 } 916 917 func (this RTCRtpSender) Once() RTCRtpSender { 918 this.ref.Once() 919 return this 920 } 921 922 func (this RTCRtpSender) Ref() js.Ref { 923 return this.ref 924 } 925 926 func (this RTCRtpSender) FromRef(ref js.Ref) RTCRtpSender { 927 this.ref = ref 928 return this 929 } 930 931 func (this RTCRtpSender) Free() { 932 this.ref.Free() 933 } 934 935 // Track returns the value of property "RTCRtpSender.track". 936 // 937 // It returns ok=false if there is no such property. 938 func (this RTCRtpSender) Track() (ret MediaStreamTrack, ok bool) { 939 ok = js.True == bindings.GetRTCRtpSenderTrack( 940 this.ref, js.Pointer(&ret), 941 ) 942 return 943 } 944 945 // Transport returns the value of property "RTCRtpSender.transport". 946 // 947 // It returns ok=false if there is no such property. 948 func (this RTCRtpSender) Transport() (ret RTCDtlsTransport, ok bool) { 949 ok = js.True == bindings.GetRTCRtpSenderTransport( 950 this.ref, js.Pointer(&ret), 951 ) 952 return 953 } 954 955 // Dtmf returns the value of property "RTCRtpSender.dtmf". 956 // 957 // It returns ok=false if there is no such property. 958 func (this RTCRtpSender) Dtmf() (ret RTCDTMFSender, ok bool) { 959 ok = js.True == bindings.GetRTCRtpSenderDtmf( 960 this.ref, js.Pointer(&ret), 961 ) 962 return 963 } 964 965 // Transform returns the value of property "RTCRtpSender.transform". 966 // 967 // It returns ok=false if there is no such property. 968 func (this RTCRtpSender) Transform() (ret RTCRtpTransform, ok bool) { 969 ok = js.True == bindings.GetRTCRtpSenderTransform( 970 this.ref, js.Pointer(&ret), 971 ) 972 return 973 } 974 975 // SetTransform sets the value of property "RTCRtpSender.transform" to val. 976 // 977 // It returns false if the property cannot be set. 978 func (this RTCRtpSender) SetTransform(val RTCRtpTransform) bool { 979 return js.True == bindings.SetRTCRtpSenderTransform( 980 this.ref, 981 val.Ref(), 982 ) 983 } 984 985 // HasFuncGetCapabilities returns true if the static method "RTCRtpSender.getCapabilities" exists. 986 func (this RTCRtpSender) HasFuncGetCapabilities() bool { 987 return js.True == bindings.HasFuncRTCRtpSenderGetCapabilities( 988 this.ref, 989 ) 990 } 991 992 // FuncGetCapabilities returns the static method "RTCRtpSender.getCapabilities". 993 func (this RTCRtpSender) FuncGetCapabilities() (fn js.Func[func(kind js.String) RTCRtpCapabilities]) { 994 bindings.FuncRTCRtpSenderGetCapabilities( 995 this.ref, js.Pointer(&fn), 996 ) 997 return 998 } 999 1000 // GetCapabilities calls the static method "RTCRtpSender.getCapabilities". 1001 func (this RTCRtpSender) GetCapabilities(kind js.String) (ret RTCRtpCapabilities) { 1002 bindings.CallRTCRtpSenderGetCapabilities( 1003 this.ref, js.Pointer(&ret), 1004 kind.Ref(), 1005 ) 1006 1007 return 1008 } 1009 1010 // TryGetCapabilities calls the static method "RTCRtpSender.getCapabilities" 1011 // in a try/catch block and returns (_, err, ok = false) when it went through 1012 // the catch clause. 1013 func (this RTCRtpSender) TryGetCapabilities(kind js.String) (ret RTCRtpCapabilities, exception js.Any, ok bool) { 1014 ok = js.True == bindings.TryRTCRtpSenderGetCapabilities( 1015 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1016 kind.Ref(), 1017 ) 1018 1019 return 1020 } 1021 1022 // HasFuncSetParameters returns true if the method "RTCRtpSender.setParameters" exists. 1023 func (this RTCRtpSender) HasFuncSetParameters() bool { 1024 return js.True == bindings.HasFuncRTCRtpSenderSetParameters( 1025 this.ref, 1026 ) 1027 } 1028 1029 // FuncSetParameters returns the method "RTCRtpSender.setParameters". 1030 func (this RTCRtpSender) FuncSetParameters() (fn js.Func[func(parameters RTCRtpSendParameters, setParameterOptions RTCSetParameterOptions) js.Promise[js.Void]]) { 1031 bindings.FuncRTCRtpSenderSetParameters( 1032 this.ref, js.Pointer(&fn), 1033 ) 1034 return 1035 } 1036 1037 // SetParameters calls the method "RTCRtpSender.setParameters". 1038 func (this RTCRtpSender) SetParameters(parameters RTCRtpSendParameters, setParameterOptions RTCSetParameterOptions) (ret js.Promise[js.Void]) { 1039 bindings.CallRTCRtpSenderSetParameters( 1040 this.ref, js.Pointer(&ret), 1041 js.Pointer(¶meters), 1042 js.Pointer(&setParameterOptions), 1043 ) 1044 1045 return 1046 } 1047 1048 // TrySetParameters calls the method "RTCRtpSender.setParameters" 1049 // in a try/catch block and returns (_, err, ok = false) when it went through 1050 // the catch clause. 1051 func (this RTCRtpSender) TrySetParameters(parameters RTCRtpSendParameters, setParameterOptions RTCSetParameterOptions) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1052 ok = js.True == bindings.TryRTCRtpSenderSetParameters( 1053 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1054 js.Pointer(¶meters), 1055 js.Pointer(&setParameterOptions), 1056 ) 1057 1058 return 1059 } 1060 1061 // HasFuncSetParameters1 returns true if the method "RTCRtpSender.setParameters" exists. 1062 func (this RTCRtpSender) HasFuncSetParameters1() bool { 1063 return js.True == bindings.HasFuncRTCRtpSenderSetParameters1( 1064 this.ref, 1065 ) 1066 } 1067 1068 // FuncSetParameters1 returns the method "RTCRtpSender.setParameters". 1069 func (this RTCRtpSender) FuncSetParameters1() (fn js.Func[func(parameters RTCRtpSendParameters) js.Promise[js.Void]]) { 1070 bindings.FuncRTCRtpSenderSetParameters1( 1071 this.ref, js.Pointer(&fn), 1072 ) 1073 return 1074 } 1075 1076 // SetParameters1 calls the method "RTCRtpSender.setParameters". 1077 func (this RTCRtpSender) SetParameters1(parameters RTCRtpSendParameters) (ret js.Promise[js.Void]) { 1078 bindings.CallRTCRtpSenderSetParameters1( 1079 this.ref, js.Pointer(&ret), 1080 js.Pointer(¶meters), 1081 ) 1082 1083 return 1084 } 1085 1086 // TrySetParameters1 calls the method "RTCRtpSender.setParameters" 1087 // in a try/catch block and returns (_, err, ok = false) when it went through 1088 // the catch clause. 1089 func (this RTCRtpSender) TrySetParameters1(parameters RTCRtpSendParameters) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1090 ok = js.True == bindings.TryRTCRtpSenderSetParameters1( 1091 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1092 js.Pointer(¶meters), 1093 ) 1094 1095 return 1096 } 1097 1098 // HasFuncGetParameters returns true if the method "RTCRtpSender.getParameters" exists. 1099 func (this RTCRtpSender) HasFuncGetParameters() bool { 1100 return js.True == bindings.HasFuncRTCRtpSenderGetParameters( 1101 this.ref, 1102 ) 1103 } 1104 1105 // FuncGetParameters returns the method "RTCRtpSender.getParameters". 1106 func (this RTCRtpSender) FuncGetParameters() (fn js.Func[func() RTCRtpSendParameters]) { 1107 bindings.FuncRTCRtpSenderGetParameters( 1108 this.ref, js.Pointer(&fn), 1109 ) 1110 return 1111 } 1112 1113 // GetParameters calls the method "RTCRtpSender.getParameters". 1114 func (this RTCRtpSender) GetParameters() (ret RTCRtpSendParameters) { 1115 bindings.CallRTCRtpSenderGetParameters( 1116 this.ref, js.Pointer(&ret), 1117 ) 1118 1119 return 1120 } 1121 1122 // TryGetParameters calls the method "RTCRtpSender.getParameters" 1123 // in a try/catch block and returns (_, err, ok = false) when it went through 1124 // the catch clause. 1125 func (this RTCRtpSender) TryGetParameters() (ret RTCRtpSendParameters, exception js.Any, ok bool) { 1126 ok = js.True == bindings.TryRTCRtpSenderGetParameters( 1127 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1128 ) 1129 1130 return 1131 } 1132 1133 // HasFuncReplaceTrack returns true if the method "RTCRtpSender.replaceTrack" exists. 1134 func (this RTCRtpSender) HasFuncReplaceTrack() bool { 1135 return js.True == bindings.HasFuncRTCRtpSenderReplaceTrack( 1136 this.ref, 1137 ) 1138 } 1139 1140 // FuncReplaceTrack returns the method "RTCRtpSender.replaceTrack". 1141 func (this RTCRtpSender) FuncReplaceTrack() (fn js.Func[func(withTrack MediaStreamTrack) js.Promise[js.Void]]) { 1142 bindings.FuncRTCRtpSenderReplaceTrack( 1143 this.ref, js.Pointer(&fn), 1144 ) 1145 return 1146 } 1147 1148 // ReplaceTrack calls the method "RTCRtpSender.replaceTrack". 1149 func (this RTCRtpSender) ReplaceTrack(withTrack MediaStreamTrack) (ret js.Promise[js.Void]) { 1150 bindings.CallRTCRtpSenderReplaceTrack( 1151 this.ref, js.Pointer(&ret), 1152 withTrack.Ref(), 1153 ) 1154 1155 return 1156 } 1157 1158 // TryReplaceTrack calls the method "RTCRtpSender.replaceTrack" 1159 // in a try/catch block and returns (_, err, ok = false) when it went through 1160 // the catch clause. 1161 func (this RTCRtpSender) TryReplaceTrack(withTrack MediaStreamTrack) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1162 ok = js.True == bindings.TryRTCRtpSenderReplaceTrack( 1163 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1164 withTrack.Ref(), 1165 ) 1166 1167 return 1168 } 1169 1170 // HasFuncSetStreams returns true if the method "RTCRtpSender.setStreams" exists. 1171 func (this RTCRtpSender) HasFuncSetStreams() bool { 1172 return js.True == bindings.HasFuncRTCRtpSenderSetStreams( 1173 this.ref, 1174 ) 1175 } 1176 1177 // FuncSetStreams returns the method "RTCRtpSender.setStreams". 1178 func (this RTCRtpSender) FuncSetStreams() (fn js.Func[func(streams ...MediaStream)]) { 1179 bindings.FuncRTCRtpSenderSetStreams( 1180 this.ref, js.Pointer(&fn), 1181 ) 1182 return 1183 } 1184 1185 // SetStreams calls the method "RTCRtpSender.setStreams". 1186 func (this RTCRtpSender) SetStreams(streams ...MediaStream) (ret js.Void) { 1187 bindings.CallRTCRtpSenderSetStreams( 1188 this.ref, js.Pointer(&ret), 1189 js.SliceData(streams), 1190 js.SizeU(len(streams)), 1191 ) 1192 1193 return 1194 } 1195 1196 // TrySetStreams calls the method "RTCRtpSender.setStreams" 1197 // in a try/catch block and returns (_, err, ok = false) when it went through 1198 // the catch clause. 1199 func (this RTCRtpSender) TrySetStreams(streams ...MediaStream) (ret js.Void, exception js.Any, ok bool) { 1200 ok = js.True == bindings.TryRTCRtpSenderSetStreams( 1201 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1202 js.SliceData(streams), 1203 js.SizeU(len(streams)), 1204 ) 1205 1206 return 1207 } 1208 1209 // HasFuncGetStats returns true if the method "RTCRtpSender.getStats" exists. 1210 func (this RTCRtpSender) HasFuncGetStats() bool { 1211 return js.True == bindings.HasFuncRTCRtpSenderGetStats( 1212 this.ref, 1213 ) 1214 } 1215 1216 // FuncGetStats returns the method "RTCRtpSender.getStats". 1217 func (this RTCRtpSender) FuncGetStats() (fn js.Func[func() js.Promise[RTCStatsReport]]) { 1218 bindings.FuncRTCRtpSenderGetStats( 1219 this.ref, js.Pointer(&fn), 1220 ) 1221 return 1222 } 1223 1224 // GetStats calls the method "RTCRtpSender.getStats". 1225 func (this RTCRtpSender) GetStats() (ret js.Promise[RTCStatsReport]) { 1226 bindings.CallRTCRtpSenderGetStats( 1227 this.ref, js.Pointer(&ret), 1228 ) 1229 1230 return 1231 } 1232 1233 // TryGetStats calls the method "RTCRtpSender.getStats" 1234 // in a try/catch block and returns (_, err, ok = false) when it went through 1235 // the catch clause. 1236 func (this RTCRtpSender) TryGetStats() (ret js.Promise[RTCStatsReport], exception js.Any, ok bool) { 1237 ok = js.True == bindings.TryRTCRtpSenderGetStats( 1238 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1239 ) 1240 1241 return 1242 } 1243 1244 // HasFuncGenerateKeyFrame returns true if the method "RTCRtpSender.generateKeyFrame" exists. 1245 func (this RTCRtpSender) HasFuncGenerateKeyFrame() bool { 1246 return js.True == bindings.HasFuncRTCRtpSenderGenerateKeyFrame( 1247 this.ref, 1248 ) 1249 } 1250 1251 // FuncGenerateKeyFrame returns the method "RTCRtpSender.generateKeyFrame". 1252 func (this RTCRtpSender) FuncGenerateKeyFrame() (fn js.Func[func(rids js.Array[js.String]) js.Promise[js.Void]]) { 1253 bindings.FuncRTCRtpSenderGenerateKeyFrame( 1254 this.ref, js.Pointer(&fn), 1255 ) 1256 return 1257 } 1258 1259 // GenerateKeyFrame calls the method "RTCRtpSender.generateKeyFrame". 1260 func (this RTCRtpSender) GenerateKeyFrame(rids js.Array[js.String]) (ret js.Promise[js.Void]) { 1261 bindings.CallRTCRtpSenderGenerateKeyFrame( 1262 this.ref, js.Pointer(&ret), 1263 rids.Ref(), 1264 ) 1265 1266 return 1267 } 1268 1269 // TryGenerateKeyFrame calls the method "RTCRtpSender.generateKeyFrame" 1270 // in a try/catch block and returns (_, err, ok = false) when it went through 1271 // the catch clause. 1272 func (this RTCRtpSender) TryGenerateKeyFrame(rids js.Array[js.String]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1273 ok = js.True == bindings.TryRTCRtpSenderGenerateKeyFrame( 1274 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1275 rids.Ref(), 1276 ) 1277 1278 return 1279 } 1280 1281 // HasFuncGenerateKeyFrame1 returns true if the method "RTCRtpSender.generateKeyFrame" exists. 1282 func (this RTCRtpSender) HasFuncGenerateKeyFrame1() bool { 1283 return js.True == bindings.HasFuncRTCRtpSenderGenerateKeyFrame1( 1284 this.ref, 1285 ) 1286 } 1287 1288 // FuncGenerateKeyFrame1 returns the method "RTCRtpSender.generateKeyFrame". 1289 func (this RTCRtpSender) FuncGenerateKeyFrame1() (fn js.Func[func() js.Promise[js.Void]]) { 1290 bindings.FuncRTCRtpSenderGenerateKeyFrame1( 1291 this.ref, js.Pointer(&fn), 1292 ) 1293 return 1294 } 1295 1296 // GenerateKeyFrame1 calls the method "RTCRtpSender.generateKeyFrame". 1297 func (this RTCRtpSender) GenerateKeyFrame1() (ret js.Promise[js.Void]) { 1298 bindings.CallRTCRtpSenderGenerateKeyFrame1( 1299 this.ref, js.Pointer(&ret), 1300 ) 1301 1302 return 1303 } 1304 1305 // TryGenerateKeyFrame1 calls the method "RTCRtpSender.generateKeyFrame" 1306 // in a try/catch block and returns (_, err, ok = false) when it went through 1307 // the catch clause. 1308 func (this RTCRtpSender) TryGenerateKeyFrame1() (ret js.Promise[js.Void], exception js.Any, ok bool) { 1309 ok = js.True == bindings.TryRTCRtpSenderGenerateKeyFrame1( 1310 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1311 ) 1312 1313 return 1314 } 1315 1316 type RTCRtpReceiveParameters struct { 1317 // HeaderExtensions is "RTCRtpReceiveParameters.headerExtensions" 1318 // 1319 // Required 1320 HeaderExtensions js.Array[RTCRtpHeaderExtensionParameters] 1321 // Rtcp is "RTCRtpReceiveParameters.rtcp" 1322 // 1323 // Required 1324 // 1325 // NOTE: Rtcp.FFI_USE MUST be set to true to get Rtcp used. 1326 Rtcp RTCRtcpParameters 1327 // Codecs is "RTCRtpReceiveParameters.codecs" 1328 // 1329 // Required 1330 Codecs js.Array[RTCRtpCodecParameters] 1331 1332 FFI_USE bool 1333 } 1334 1335 // FromRef calls UpdateFrom and returns a RTCRtpReceiveParameters with all fields set. 1336 func (p RTCRtpReceiveParameters) FromRef(ref js.Ref) RTCRtpReceiveParameters { 1337 p.UpdateFrom(ref) 1338 return p 1339 } 1340 1341 // New creates a new RTCRtpReceiveParameters in the application heap. 1342 func (p RTCRtpReceiveParameters) New() js.Ref { 1343 return bindings.RTCRtpReceiveParametersJSLoad( 1344 js.Pointer(&p), js.True, 0, 1345 ) 1346 } 1347 1348 // UpdateFrom copies value of all fields of the heap object to p. 1349 func (p *RTCRtpReceiveParameters) UpdateFrom(ref js.Ref) { 1350 bindings.RTCRtpReceiveParametersJSStore( 1351 js.Pointer(p), ref, 1352 ) 1353 } 1354 1355 // Update writes all fields of the p to the heap object referenced by ref. 1356 func (p *RTCRtpReceiveParameters) Update(ref js.Ref) { 1357 bindings.RTCRtpReceiveParametersJSLoad( 1358 js.Pointer(p), js.False, ref, 1359 ) 1360 } 1361 1362 // FreeMembers frees fields with heap reference, if recursive is true 1363 // free all heap references reachable from p. 1364 func (p *RTCRtpReceiveParameters) FreeMembers(recursive bool) { 1365 js.Free( 1366 p.HeaderExtensions.Ref(), 1367 p.Codecs.Ref(), 1368 ) 1369 p.HeaderExtensions = p.HeaderExtensions.FromRef(js.Undefined) 1370 p.Codecs = p.Codecs.FromRef(js.Undefined) 1371 if recursive { 1372 p.Rtcp.FreeMembers(true) 1373 } 1374 } 1375 1376 type RTCRtpContributingSource struct { 1377 // Timestamp is "RTCRtpContributingSource.timestamp" 1378 // 1379 // Required 1380 Timestamp DOMHighResTimeStamp 1381 // Source is "RTCRtpContributingSource.source" 1382 // 1383 // Required 1384 Source uint32 1385 // AudioLevel is "RTCRtpContributingSource.audioLevel" 1386 // 1387 // Optional 1388 // 1389 // NOTE: FFI_USE_AudioLevel MUST be set to true to make this field effective. 1390 AudioLevel float64 1391 // RtpTimestamp is "RTCRtpContributingSource.rtpTimestamp" 1392 // 1393 // Required 1394 RtpTimestamp uint32 1395 1396 FFI_USE_AudioLevel bool // for AudioLevel. 1397 1398 FFI_USE bool 1399 } 1400 1401 // FromRef calls UpdateFrom and returns a RTCRtpContributingSource with all fields set. 1402 func (p RTCRtpContributingSource) FromRef(ref js.Ref) RTCRtpContributingSource { 1403 p.UpdateFrom(ref) 1404 return p 1405 } 1406 1407 // New creates a new RTCRtpContributingSource in the application heap. 1408 func (p RTCRtpContributingSource) New() js.Ref { 1409 return bindings.RTCRtpContributingSourceJSLoad( 1410 js.Pointer(&p), js.True, 0, 1411 ) 1412 } 1413 1414 // UpdateFrom copies value of all fields of the heap object to p. 1415 func (p *RTCRtpContributingSource) UpdateFrom(ref js.Ref) { 1416 bindings.RTCRtpContributingSourceJSStore( 1417 js.Pointer(p), ref, 1418 ) 1419 } 1420 1421 // Update writes all fields of the p to the heap object referenced by ref. 1422 func (p *RTCRtpContributingSource) Update(ref js.Ref) { 1423 bindings.RTCRtpContributingSourceJSLoad( 1424 js.Pointer(p), js.False, ref, 1425 ) 1426 } 1427 1428 // FreeMembers frees fields with heap reference, if recursive is true 1429 // free all heap references reachable from p. 1430 func (p *RTCRtpContributingSource) FreeMembers(recursive bool) { 1431 } 1432 1433 type RTCRtpSynchronizationSource struct { 1434 // Timestamp is "RTCRtpSynchronizationSource.timestamp" 1435 // 1436 // Required 1437 Timestamp DOMHighResTimeStamp 1438 // Source is "RTCRtpSynchronizationSource.source" 1439 // 1440 // Required 1441 Source uint32 1442 // AudioLevel is "RTCRtpSynchronizationSource.audioLevel" 1443 // 1444 // Optional 1445 // 1446 // NOTE: FFI_USE_AudioLevel MUST be set to true to make this field effective. 1447 AudioLevel float64 1448 // RtpTimestamp is "RTCRtpSynchronizationSource.rtpTimestamp" 1449 // 1450 // Required 1451 RtpTimestamp uint32 1452 1453 FFI_USE_AudioLevel bool // for AudioLevel. 1454 1455 FFI_USE bool 1456 } 1457 1458 // FromRef calls UpdateFrom and returns a RTCRtpSynchronizationSource with all fields set. 1459 func (p RTCRtpSynchronizationSource) FromRef(ref js.Ref) RTCRtpSynchronizationSource { 1460 p.UpdateFrom(ref) 1461 return p 1462 } 1463 1464 // New creates a new RTCRtpSynchronizationSource in the application heap. 1465 func (p RTCRtpSynchronizationSource) New() js.Ref { 1466 return bindings.RTCRtpSynchronizationSourceJSLoad( 1467 js.Pointer(&p), js.True, 0, 1468 ) 1469 } 1470 1471 // UpdateFrom copies value of all fields of the heap object to p. 1472 func (p *RTCRtpSynchronizationSource) UpdateFrom(ref js.Ref) { 1473 bindings.RTCRtpSynchronizationSourceJSStore( 1474 js.Pointer(p), ref, 1475 ) 1476 } 1477 1478 // Update writes all fields of the p to the heap object referenced by ref. 1479 func (p *RTCRtpSynchronizationSource) Update(ref js.Ref) { 1480 bindings.RTCRtpSynchronizationSourceJSLoad( 1481 js.Pointer(p), js.False, ref, 1482 ) 1483 } 1484 1485 // FreeMembers frees fields with heap reference, if recursive is true 1486 // free all heap references reachable from p. 1487 func (p *RTCRtpSynchronizationSource) FreeMembers(recursive bool) { 1488 } 1489 1490 type RTCRtpReceiver struct { 1491 ref js.Ref 1492 } 1493 1494 func (this RTCRtpReceiver) Once() RTCRtpReceiver { 1495 this.ref.Once() 1496 return this 1497 } 1498 1499 func (this RTCRtpReceiver) Ref() js.Ref { 1500 return this.ref 1501 } 1502 1503 func (this RTCRtpReceiver) FromRef(ref js.Ref) RTCRtpReceiver { 1504 this.ref = ref 1505 return this 1506 } 1507 1508 func (this RTCRtpReceiver) Free() { 1509 this.ref.Free() 1510 } 1511 1512 // Track returns the value of property "RTCRtpReceiver.track". 1513 // 1514 // It returns ok=false if there is no such property. 1515 func (this RTCRtpReceiver) Track() (ret MediaStreamTrack, ok bool) { 1516 ok = js.True == bindings.GetRTCRtpReceiverTrack( 1517 this.ref, js.Pointer(&ret), 1518 ) 1519 return 1520 } 1521 1522 // Transport returns the value of property "RTCRtpReceiver.transport". 1523 // 1524 // It returns ok=false if there is no such property. 1525 func (this RTCRtpReceiver) Transport() (ret RTCDtlsTransport, ok bool) { 1526 ok = js.True == bindings.GetRTCRtpReceiverTransport( 1527 this.ref, js.Pointer(&ret), 1528 ) 1529 return 1530 } 1531 1532 // Transform returns the value of property "RTCRtpReceiver.transform". 1533 // 1534 // It returns ok=false if there is no such property. 1535 func (this RTCRtpReceiver) Transform() (ret RTCRtpTransform, ok bool) { 1536 ok = js.True == bindings.GetRTCRtpReceiverTransform( 1537 this.ref, js.Pointer(&ret), 1538 ) 1539 return 1540 } 1541 1542 // SetTransform sets the value of property "RTCRtpReceiver.transform" to val. 1543 // 1544 // It returns false if the property cannot be set. 1545 func (this RTCRtpReceiver) SetTransform(val RTCRtpTransform) bool { 1546 return js.True == bindings.SetRTCRtpReceiverTransform( 1547 this.ref, 1548 val.Ref(), 1549 ) 1550 } 1551 1552 // HasFuncGetCapabilities returns true if the static method "RTCRtpReceiver.getCapabilities" exists. 1553 func (this RTCRtpReceiver) HasFuncGetCapabilities() bool { 1554 return js.True == bindings.HasFuncRTCRtpReceiverGetCapabilities( 1555 this.ref, 1556 ) 1557 } 1558 1559 // FuncGetCapabilities returns the static method "RTCRtpReceiver.getCapabilities". 1560 func (this RTCRtpReceiver) FuncGetCapabilities() (fn js.Func[func(kind js.String) RTCRtpCapabilities]) { 1561 bindings.FuncRTCRtpReceiverGetCapabilities( 1562 this.ref, js.Pointer(&fn), 1563 ) 1564 return 1565 } 1566 1567 // GetCapabilities calls the static method "RTCRtpReceiver.getCapabilities". 1568 func (this RTCRtpReceiver) GetCapabilities(kind js.String) (ret RTCRtpCapabilities) { 1569 bindings.CallRTCRtpReceiverGetCapabilities( 1570 this.ref, js.Pointer(&ret), 1571 kind.Ref(), 1572 ) 1573 1574 return 1575 } 1576 1577 // TryGetCapabilities calls the static method "RTCRtpReceiver.getCapabilities" 1578 // in a try/catch block and returns (_, err, ok = false) when it went through 1579 // the catch clause. 1580 func (this RTCRtpReceiver) TryGetCapabilities(kind js.String) (ret RTCRtpCapabilities, exception js.Any, ok bool) { 1581 ok = js.True == bindings.TryRTCRtpReceiverGetCapabilities( 1582 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1583 kind.Ref(), 1584 ) 1585 1586 return 1587 } 1588 1589 // HasFuncGetParameters returns true if the method "RTCRtpReceiver.getParameters" exists. 1590 func (this RTCRtpReceiver) HasFuncGetParameters() bool { 1591 return js.True == bindings.HasFuncRTCRtpReceiverGetParameters( 1592 this.ref, 1593 ) 1594 } 1595 1596 // FuncGetParameters returns the method "RTCRtpReceiver.getParameters". 1597 func (this RTCRtpReceiver) FuncGetParameters() (fn js.Func[func() RTCRtpReceiveParameters]) { 1598 bindings.FuncRTCRtpReceiverGetParameters( 1599 this.ref, js.Pointer(&fn), 1600 ) 1601 return 1602 } 1603 1604 // GetParameters calls the method "RTCRtpReceiver.getParameters". 1605 func (this RTCRtpReceiver) GetParameters() (ret RTCRtpReceiveParameters) { 1606 bindings.CallRTCRtpReceiverGetParameters( 1607 this.ref, js.Pointer(&ret), 1608 ) 1609 1610 return 1611 } 1612 1613 // TryGetParameters calls the method "RTCRtpReceiver.getParameters" 1614 // in a try/catch block and returns (_, err, ok = false) when it went through 1615 // the catch clause. 1616 func (this RTCRtpReceiver) TryGetParameters() (ret RTCRtpReceiveParameters, exception js.Any, ok bool) { 1617 ok = js.True == bindings.TryRTCRtpReceiverGetParameters( 1618 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1619 ) 1620 1621 return 1622 } 1623 1624 // HasFuncGetContributingSources returns true if the method "RTCRtpReceiver.getContributingSources" exists. 1625 func (this RTCRtpReceiver) HasFuncGetContributingSources() bool { 1626 return js.True == bindings.HasFuncRTCRtpReceiverGetContributingSources( 1627 this.ref, 1628 ) 1629 } 1630 1631 // FuncGetContributingSources returns the method "RTCRtpReceiver.getContributingSources". 1632 func (this RTCRtpReceiver) FuncGetContributingSources() (fn js.Func[func() js.Array[RTCRtpContributingSource]]) { 1633 bindings.FuncRTCRtpReceiverGetContributingSources( 1634 this.ref, js.Pointer(&fn), 1635 ) 1636 return 1637 } 1638 1639 // GetContributingSources calls the method "RTCRtpReceiver.getContributingSources". 1640 func (this RTCRtpReceiver) GetContributingSources() (ret js.Array[RTCRtpContributingSource]) { 1641 bindings.CallRTCRtpReceiverGetContributingSources( 1642 this.ref, js.Pointer(&ret), 1643 ) 1644 1645 return 1646 } 1647 1648 // TryGetContributingSources calls the method "RTCRtpReceiver.getContributingSources" 1649 // in a try/catch block and returns (_, err, ok = false) when it went through 1650 // the catch clause. 1651 func (this RTCRtpReceiver) TryGetContributingSources() (ret js.Array[RTCRtpContributingSource], exception js.Any, ok bool) { 1652 ok = js.True == bindings.TryRTCRtpReceiverGetContributingSources( 1653 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1654 ) 1655 1656 return 1657 } 1658 1659 // HasFuncGetSynchronizationSources returns true if the method "RTCRtpReceiver.getSynchronizationSources" exists. 1660 func (this RTCRtpReceiver) HasFuncGetSynchronizationSources() bool { 1661 return js.True == bindings.HasFuncRTCRtpReceiverGetSynchronizationSources( 1662 this.ref, 1663 ) 1664 } 1665 1666 // FuncGetSynchronizationSources returns the method "RTCRtpReceiver.getSynchronizationSources". 1667 func (this RTCRtpReceiver) FuncGetSynchronizationSources() (fn js.Func[func() js.Array[RTCRtpSynchronizationSource]]) { 1668 bindings.FuncRTCRtpReceiverGetSynchronizationSources( 1669 this.ref, js.Pointer(&fn), 1670 ) 1671 return 1672 } 1673 1674 // GetSynchronizationSources calls the method "RTCRtpReceiver.getSynchronizationSources". 1675 func (this RTCRtpReceiver) GetSynchronizationSources() (ret js.Array[RTCRtpSynchronizationSource]) { 1676 bindings.CallRTCRtpReceiverGetSynchronizationSources( 1677 this.ref, js.Pointer(&ret), 1678 ) 1679 1680 return 1681 } 1682 1683 // TryGetSynchronizationSources calls the method "RTCRtpReceiver.getSynchronizationSources" 1684 // in a try/catch block and returns (_, err, ok = false) when it went through 1685 // the catch clause. 1686 func (this RTCRtpReceiver) TryGetSynchronizationSources() (ret js.Array[RTCRtpSynchronizationSource], exception js.Any, ok bool) { 1687 ok = js.True == bindings.TryRTCRtpReceiverGetSynchronizationSources( 1688 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1689 ) 1690 1691 return 1692 } 1693 1694 // HasFuncGetStats returns true if the method "RTCRtpReceiver.getStats" exists. 1695 func (this RTCRtpReceiver) HasFuncGetStats() bool { 1696 return js.True == bindings.HasFuncRTCRtpReceiverGetStats( 1697 this.ref, 1698 ) 1699 } 1700 1701 // FuncGetStats returns the method "RTCRtpReceiver.getStats". 1702 func (this RTCRtpReceiver) FuncGetStats() (fn js.Func[func() js.Promise[RTCStatsReport]]) { 1703 bindings.FuncRTCRtpReceiverGetStats( 1704 this.ref, js.Pointer(&fn), 1705 ) 1706 return 1707 } 1708 1709 // GetStats calls the method "RTCRtpReceiver.getStats". 1710 func (this RTCRtpReceiver) GetStats() (ret js.Promise[RTCStatsReport]) { 1711 bindings.CallRTCRtpReceiverGetStats( 1712 this.ref, js.Pointer(&ret), 1713 ) 1714 1715 return 1716 } 1717 1718 // TryGetStats calls the method "RTCRtpReceiver.getStats" 1719 // in a try/catch block and returns (_, err, ok = false) when it went through 1720 // the catch clause. 1721 func (this RTCRtpReceiver) TryGetStats() (ret js.Promise[RTCStatsReport], exception js.Any, ok bool) { 1722 ok = js.True == bindings.TryRTCRtpReceiverGetStats( 1723 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1724 ) 1725 1726 return 1727 } 1728 1729 type RTCRtpTransceiverDirection uint32 1730 1731 const ( 1732 _ RTCRtpTransceiverDirection = iota 1733 1734 RTCRtpTransceiverDirection_SENDRECV 1735 RTCRtpTransceiverDirection_SENDONLY 1736 RTCRtpTransceiverDirection_RECVONLY 1737 RTCRtpTransceiverDirection_INACTIVE 1738 RTCRtpTransceiverDirection_STOPPED 1739 ) 1740 1741 func (RTCRtpTransceiverDirection) FromRef(str js.Ref) RTCRtpTransceiverDirection { 1742 return RTCRtpTransceiverDirection(bindings.ConstOfRTCRtpTransceiverDirection(str)) 1743 } 1744 1745 func (x RTCRtpTransceiverDirection) String() (string, bool) { 1746 switch x { 1747 case RTCRtpTransceiverDirection_SENDRECV: 1748 return "sendrecv", true 1749 case RTCRtpTransceiverDirection_SENDONLY: 1750 return "sendonly", true 1751 case RTCRtpTransceiverDirection_RECVONLY: 1752 return "recvonly", true 1753 case RTCRtpTransceiverDirection_INACTIVE: 1754 return "inactive", true 1755 case RTCRtpTransceiverDirection_STOPPED: 1756 return "stopped", true 1757 default: 1758 return "", false 1759 } 1760 } 1761 1762 type RTCRtpTransceiver struct { 1763 ref js.Ref 1764 } 1765 1766 func (this RTCRtpTransceiver) Once() RTCRtpTransceiver { 1767 this.ref.Once() 1768 return this 1769 } 1770 1771 func (this RTCRtpTransceiver) Ref() js.Ref { 1772 return this.ref 1773 } 1774 1775 func (this RTCRtpTransceiver) FromRef(ref js.Ref) RTCRtpTransceiver { 1776 this.ref = ref 1777 return this 1778 } 1779 1780 func (this RTCRtpTransceiver) Free() { 1781 this.ref.Free() 1782 } 1783 1784 // Mid returns the value of property "RTCRtpTransceiver.mid". 1785 // 1786 // It returns ok=false if there is no such property. 1787 func (this RTCRtpTransceiver) Mid() (ret js.String, ok bool) { 1788 ok = js.True == bindings.GetRTCRtpTransceiverMid( 1789 this.ref, js.Pointer(&ret), 1790 ) 1791 return 1792 } 1793 1794 // Sender returns the value of property "RTCRtpTransceiver.sender". 1795 // 1796 // It returns ok=false if there is no such property. 1797 func (this RTCRtpTransceiver) Sender() (ret RTCRtpSender, ok bool) { 1798 ok = js.True == bindings.GetRTCRtpTransceiverSender( 1799 this.ref, js.Pointer(&ret), 1800 ) 1801 return 1802 } 1803 1804 // Receiver returns the value of property "RTCRtpTransceiver.receiver". 1805 // 1806 // It returns ok=false if there is no such property. 1807 func (this RTCRtpTransceiver) Receiver() (ret RTCRtpReceiver, ok bool) { 1808 ok = js.True == bindings.GetRTCRtpTransceiverReceiver( 1809 this.ref, js.Pointer(&ret), 1810 ) 1811 return 1812 } 1813 1814 // Direction returns the value of property "RTCRtpTransceiver.direction". 1815 // 1816 // It returns ok=false if there is no such property. 1817 func (this RTCRtpTransceiver) Direction() (ret RTCRtpTransceiverDirection, ok bool) { 1818 ok = js.True == bindings.GetRTCRtpTransceiverDirection( 1819 this.ref, js.Pointer(&ret), 1820 ) 1821 return 1822 } 1823 1824 // SetDirection sets the value of property "RTCRtpTransceiver.direction" to val. 1825 // 1826 // It returns false if the property cannot be set. 1827 func (this RTCRtpTransceiver) SetDirection(val RTCRtpTransceiverDirection) bool { 1828 return js.True == bindings.SetRTCRtpTransceiverDirection( 1829 this.ref, 1830 uint32(val), 1831 ) 1832 } 1833 1834 // CurrentDirection returns the value of property "RTCRtpTransceiver.currentDirection". 1835 // 1836 // It returns ok=false if there is no such property. 1837 func (this RTCRtpTransceiver) CurrentDirection() (ret RTCRtpTransceiverDirection, ok bool) { 1838 ok = js.True == bindings.GetRTCRtpTransceiverCurrentDirection( 1839 this.ref, js.Pointer(&ret), 1840 ) 1841 return 1842 } 1843 1844 // HasFuncStop returns true if the method "RTCRtpTransceiver.stop" exists. 1845 func (this RTCRtpTransceiver) HasFuncStop() bool { 1846 return js.True == bindings.HasFuncRTCRtpTransceiverStop( 1847 this.ref, 1848 ) 1849 } 1850 1851 // FuncStop returns the method "RTCRtpTransceiver.stop". 1852 func (this RTCRtpTransceiver) FuncStop() (fn js.Func[func()]) { 1853 bindings.FuncRTCRtpTransceiverStop( 1854 this.ref, js.Pointer(&fn), 1855 ) 1856 return 1857 } 1858 1859 // Stop calls the method "RTCRtpTransceiver.stop". 1860 func (this RTCRtpTransceiver) Stop() (ret js.Void) { 1861 bindings.CallRTCRtpTransceiverStop( 1862 this.ref, js.Pointer(&ret), 1863 ) 1864 1865 return 1866 } 1867 1868 // TryStop calls the method "RTCRtpTransceiver.stop" 1869 // in a try/catch block and returns (_, err, ok = false) when it went through 1870 // the catch clause. 1871 func (this RTCRtpTransceiver) TryStop() (ret js.Void, exception js.Any, ok bool) { 1872 ok = js.True == bindings.TryRTCRtpTransceiverStop( 1873 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1874 ) 1875 1876 return 1877 } 1878 1879 // HasFuncSetCodecPreferences returns true if the method "RTCRtpTransceiver.setCodecPreferences" exists. 1880 func (this RTCRtpTransceiver) HasFuncSetCodecPreferences() bool { 1881 return js.True == bindings.HasFuncRTCRtpTransceiverSetCodecPreferences( 1882 this.ref, 1883 ) 1884 } 1885 1886 // FuncSetCodecPreferences returns the method "RTCRtpTransceiver.setCodecPreferences". 1887 func (this RTCRtpTransceiver) FuncSetCodecPreferences() (fn js.Func[func(codecs js.Array[RTCRtpCodecCapability])]) { 1888 bindings.FuncRTCRtpTransceiverSetCodecPreferences( 1889 this.ref, js.Pointer(&fn), 1890 ) 1891 return 1892 } 1893 1894 // SetCodecPreferences calls the method "RTCRtpTransceiver.setCodecPreferences". 1895 func (this RTCRtpTransceiver) SetCodecPreferences(codecs js.Array[RTCRtpCodecCapability]) (ret js.Void) { 1896 bindings.CallRTCRtpTransceiverSetCodecPreferences( 1897 this.ref, js.Pointer(&ret), 1898 codecs.Ref(), 1899 ) 1900 1901 return 1902 } 1903 1904 // TrySetCodecPreferences calls the method "RTCRtpTransceiver.setCodecPreferences" 1905 // in a try/catch block and returns (_, err, ok = false) when it went through 1906 // the catch clause. 1907 func (this RTCRtpTransceiver) TrySetCodecPreferences(codecs js.Array[RTCRtpCodecCapability]) (ret js.Void, exception js.Any, ok bool) { 1908 ok = js.True == bindings.TryRTCRtpTransceiverSetCodecPreferences( 1909 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1910 codecs.Ref(), 1911 ) 1912 1913 return 1914 } 1915 1916 type OneOf_MediaStreamTrack_String struct { 1917 ref js.Ref 1918 } 1919 1920 func (x OneOf_MediaStreamTrack_String) Ref() js.Ref { 1921 return x.ref 1922 } 1923 1924 func (x OneOf_MediaStreamTrack_String) Free() { 1925 x.ref.Free() 1926 } 1927 1928 func (x OneOf_MediaStreamTrack_String) FromRef(ref js.Ref) OneOf_MediaStreamTrack_String { 1929 return OneOf_MediaStreamTrack_String{ 1930 ref: ref, 1931 } 1932 } 1933 1934 func (x OneOf_MediaStreamTrack_String) MediaStreamTrack() MediaStreamTrack { 1935 return MediaStreamTrack{}.FromRef(x.ref) 1936 } 1937 1938 func (x OneOf_MediaStreamTrack_String) String() js.String { 1939 return js.String{}.FromRef(x.ref) 1940 } 1941 1942 type RTCRtpTransceiverInit struct { 1943 // Direction is "RTCRtpTransceiverInit.direction" 1944 // 1945 // Optional, defaults to "sendrecv". 1946 Direction RTCRtpTransceiverDirection 1947 // Streams is "RTCRtpTransceiverInit.streams" 1948 // 1949 // Optional, defaults to []. 1950 Streams js.Array[MediaStream] 1951 // SendEncodings is "RTCRtpTransceiverInit.sendEncodings" 1952 // 1953 // Optional, defaults to []. 1954 SendEncodings js.Array[RTCRtpEncodingParameters] 1955 1956 FFI_USE bool 1957 } 1958 1959 // FromRef calls UpdateFrom and returns a RTCRtpTransceiverInit with all fields set. 1960 func (p RTCRtpTransceiverInit) FromRef(ref js.Ref) RTCRtpTransceiverInit { 1961 p.UpdateFrom(ref) 1962 return p 1963 } 1964 1965 // New creates a new RTCRtpTransceiverInit in the application heap. 1966 func (p RTCRtpTransceiverInit) New() js.Ref { 1967 return bindings.RTCRtpTransceiverInitJSLoad( 1968 js.Pointer(&p), js.True, 0, 1969 ) 1970 } 1971 1972 // UpdateFrom copies value of all fields of the heap object to p. 1973 func (p *RTCRtpTransceiverInit) UpdateFrom(ref js.Ref) { 1974 bindings.RTCRtpTransceiverInitJSStore( 1975 js.Pointer(p), ref, 1976 ) 1977 } 1978 1979 // Update writes all fields of the p to the heap object referenced by ref. 1980 func (p *RTCRtpTransceiverInit) Update(ref js.Ref) { 1981 bindings.RTCRtpTransceiverInitJSLoad( 1982 js.Pointer(p), js.False, ref, 1983 ) 1984 } 1985 1986 // FreeMembers frees fields with heap reference, if recursive is true 1987 // free all heap references reachable from p. 1988 func (p *RTCRtpTransceiverInit) FreeMembers(recursive bool) { 1989 js.Free( 1990 p.Streams.Ref(), 1991 p.SendEncodings.Ref(), 1992 ) 1993 p.Streams = p.Streams.FromRef(js.Undefined) 1994 p.SendEncodings = p.SendEncodings.FromRef(js.Undefined) 1995 } 1996 1997 func NewRTCSessionDescription(descriptionInitDict RTCSessionDescriptionInit) (ret RTCSessionDescription) { 1998 ret.ref = bindings.NewRTCSessionDescriptionByRTCSessionDescription( 1999 js.Pointer(&descriptionInitDict)) 2000 return 2001 } 2002 2003 type RTCSessionDescription struct { 2004 ref js.Ref 2005 } 2006 2007 func (this RTCSessionDescription) Once() RTCSessionDescription { 2008 this.ref.Once() 2009 return this 2010 } 2011 2012 func (this RTCSessionDescription) Ref() js.Ref { 2013 return this.ref 2014 } 2015 2016 func (this RTCSessionDescription) FromRef(ref js.Ref) RTCSessionDescription { 2017 this.ref = ref 2018 return this 2019 } 2020 2021 func (this RTCSessionDescription) Free() { 2022 this.ref.Free() 2023 } 2024 2025 // Type returns the value of property "RTCSessionDescription.type". 2026 // 2027 // It returns ok=false if there is no such property. 2028 func (this RTCSessionDescription) Type() (ret RTCSdpType, ok bool) { 2029 ok = js.True == bindings.GetRTCSessionDescriptionType( 2030 this.ref, js.Pointer(&ret), 2031 ) 2032 return 2033 } 2034 2035 // Sdp returns the value of property "RTCSessionDescription.sdp". 2036 // 2037 // It returns ok=false if there is no such property. 2038 func (this RTCSessionDescription) Sdp() (ret js.String, ok bool) { 2039 ok = js.True == bindings.GetRTCSessionDescriptionSdp( 2040 this.ref, js.Pointer(&ret), 2041 ) 2042 return 2043 } 2044 2045 // HasFuncToJSON returns true if the method "RTCSessionDescription.toJSON" exists. 2046 func (this RTCSessionDescription) HasFuncToJSON() bool { 2047 return js.True == bindings.HasFuncRTCSessionDescriptionToJSON( 2048 this.ref, 2049 ) 2050 } 2051 2052 // FuncToJSON returns the method "RTCSessionDescription.toJSON". 2053 func (this RTCSessionDescription) FuncToJSON() (fn js.Func[func() js.Object]) { 2054 bindings.FuncRTCSessionDescriptionToJSON( 2055 this.ref, js.Pointer(&fn), 2056 ) 2057 return 2058 } 2059 2060 // ToJSON calls the method "RTCSessionDescription.toJSON". 2061 func (this RTCSessionDescription) ToJSON() (ret js.Object) { 2062 bindings.CallRTCSessionDescriptionToJSON( 2063 this.ref, js.Pointer(&ret), 2064 ) 2065 2066 return 2067 } 2068 2069 // TryToJSON calls the method "RTCSessionDescription.toJSON" 2070 // in a try/catch block and returns (_, err, ok = false) when it went through 2071 // the catch clause. 2072 func (this RTCSessionDescription) TryToJSON() (ret js.Object, exception js.Any, ok bool) { 2073 ok = js.True == bindings.TryRTCSessionDescriptionToJSON( 2074 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2075 ) 2076 2077 return 2078 } 2079 2080 type RTCSignalingState uint32 2081 2082 const ( 2083 _ RTCSignalingState = iota 2084 2085 RTCSignalingState_STABLE 2086 RTCSignalingState_HAVE_LOCAL_OFFER 2087 RTCSignalingState_HAVE_REMOTE_OFFER 2088 RTCSignalingState_HAVE_LOCAL_PRANSWER 2089 RTCSignalingState_HAVE_REMOTE_PRANSWER 2090 RTCSignalingState_CLOSED 2091 ) 2092 2093 func (RTCSignalingState) FromRef(str js.Ref) RTCSignalingState { 2094 return RTCSignalingState(bindings.ConstOfRTCSignalingState(str)) 2095 } 2096 2097 func (x RTCSignalingState) String() (string, bool) { 2098 switch x { 2099 case RTCSignalingState_STABLE: 2100 return "stable", true 2101 case RTCSignalingState_HAVE_LOCAL_OFFER: 2102 return "have-local-offer", true 2103 case RTCSignalingState_HAVE_REMOTE_OFFER: 2104 return "have-remote-offer", true 2105 case RTCSignalingState_HAVE_LOCAL_PRANSWER: 2106 return "have-local-pranswer", true 2107 case RTCSignalingState_HAVE_REMOTE_PRANSWER: 2108 return "have-remote-pranswer", true 2109 case RTCSignalingState_CLOSED: 2110 return "closed", true 2111 default: 2112 return "", false 2113 } 2114 } 2115 2116 type RTCPeerConnectionState uint32 2117 2118 const ( 2119 _ RTCPeerConnectionState = iota 2120 2121 RTCPeerConnectionState_CLOSED 2122 RTCPeerConnectionState_FAILED 2123 RTCPeerConnectionState_DISCONNECTED 2124 RTCPeerConnectionState_NEW 2125 RTCPeerConnectionState_CONNECTING 2126 RTCPeerConnectionState_CONNECTED 2127 ) 2128 2129 func (RTCPeerConnectionState) FromRef(str js.Ref) RTCPeerConnectionState { 2130 return RTCPeerConnectionState(bindings.ConstOfRTCPeerConnectionState(str)) 2131 } 2132 2133 func (x RTCPeerConnectionState) String() (string, bool) { 2134 switch x { 2135 case RTCPeerConnectionState_CLOSED: 2136 return "closed", true 2137 case RTCPeerConnectionState_FAILED: 2138 return "failed", true 2139 case RTCPeerConnectionState_DISCONNECTED: 2140 return "disconnected", true 2141 case RTCPeerConnectionState_NEW: 2142 return "new", true 2143 case RTCPeerConnectionState_CONNECTING: 2144 return "connecting", true 2145 case RTCPeerConnectionState_CONNECTED: 2146 return "connected", true 2147 default: 2148 return "", false 2149 } 2150 } 2151 2152 type RTCSctpTransportState uint32 2153 2154 const ( 2155 _ RTCSctpTransportState = iota 2156 2157 RTCSctpTransportState_CONNECTING 2158 RTCSctpTransportState_CONNECTED 2159 RTCSctpTransportState_CLOSED 2160 ) 2161 2162 func (RTCSctpTransportState) FromRef(str js.Ref) RTCSctpTransportState { 2163 return RTCSctpTransportState(bindings.ConstOfRTCSctpTransportState(str)) 2164 } 2165 2166 func (x RTCSctpTransportState) String() (string, bool) { 2167 switch x { 2168 case RTCSctpTransportState_CONNECTING: 2169 return "connecting", true 2170 case RTCSctpTransportState_CONNECTED: 2171 return "connected", true 2172 case RTCSctpTransportState_CLOSED: 2173 return "closed", true 2174 default: 2175 return "", false 2176 } 2177 } 2178 2179 type RTCSctpTransport struct { 2180 EventTarget 2181 } 2182 2183 func (this RTCSctpTransport) Once() RTCSctpTransport { 2184 this.ref.Once() 2185 return this 2186 } 2187 2188 func (this RTCSctpTransport) Ref() js.Ref { 2189 return this.EventTarget.Ref() 2190 } 2191 2192 func (this RTCSctpTransport) FromRef(ref js.Ref) RTCSctpTransport { 2193 this.EventTarget = this.EventTarget.FromRef(ref) 2194 return this 2195 } 2196 2197 func (this RTCSctpTransport) Free() { 2198 this.ref.Free() 2199 } 2200 2201 // Transport returns the value of property "RTCSctpTransport.transport". 2202 // 2203 // It returns ok=false if there is no such property. 2204 func (this RTCSctpTransport) Transport() (ret RTCDtlsTransport, ok bool) { 2205 ok = js.True == bindings.GetRTCSctpTransportTransport( 2206 this.ref, js.Pointer(&ret), 2207 ) 2208 return 2209 } 2210 2211 // State returns the value of property "RTCSctpTransport.state". 2212 // 2213 // It returns ok=false if there is no such property. 2214 func (this RTCSctpTransport) State() (ret RTCSctpTransportState, ok bool) { 2215 ok = js.True == bindings.GetRTCSctpTransportState( 2216 this.ref, js.Pointer(&ret), 2217 ) 2218 return 2219 } 2220 2221 // MaxMessageSize returns the value of property "RTCSctpTransport.maxMessageSize". 2222 // 2223 // It returns ok=false if there is no such property. 2224 func (this RTCSctpTransport) MaxMessageSize() (ret float64, ok bool) { 2225 ok = js.True == bindings.GetRTCSctpTransportMaxMessageSize( 2226 this.ref, js.Pointer(&ret), 2227 ) 2228 return 2229 } 2230 2231 // MaxChannels returns the value of property "RTCSctpTransport.maxChannels". 2232 // 2233 // It returns ok=false if there is no such property. 2234 func (this RTCSctpTransport) MaxChannels() (ret uint16, ok bool) { 2235 ok = js.True == bindings.GetRTCSctpTransportMaxChannels( 2236 this.ref, js.Pointer(&ret), 2237 ) 2238 return 2239 } 2240 2241 func NewRTCPeerConnection(configuration RTCConfiguration) (ret RTCPeerConnection) { 2242 ret.ref = bindings.NewRTCPeerConnectionByRTCPeerConnection( 2243 js.Pointer(&configuration)) 2244 return 2245 } 2246 2247 func NewRTCPeerConnectionByRTCPeerConnection1() (ret RTCPeerConnection) { 2248 ret.ref = bindings.NewRTCPeerConnectionByRTCPeerConnection1() 2249 return 2250 } 2251 2252 type RTCPeerConnection struct { 2253 EventTarget 2254 } 2255 2256 func (this RTCPeerConnection) Once() RTCPeerConnection { 2257 this.ref.Once() 2258 return this 2259 } 2260 2261 func (this RTCPeerConnection) Ref() js.Ref { 2262 return this.EventTarget.Ref() 2263 } 2264 2265 func (this RTCPeerConnection) FromRef(ref js.Ref) RTCPeerConnection { 2266 this.EventTarget = this.EventTarget.FromRef(ref) 2267 return this 2268 } 2269 2270 func (this RTCPeerConnection) Free() { 2271 this.ref.Free() 2272 } 2273 2274 // LocalDescription returns the value of property "RTCPeerConnection.localDescription". 2275 // 2276 // It returns ok=false if there is no such property. 2277 func (this RTCPeerConnection) LocalDescription() (ret RTCSessionDescription, ok bool) { 2278 ok = js.True == bindings.GetRTCPeerConnectionLocalDescription( 2279 this.ref, js.Pointer(&ret), 2280 ) 2281 return 2282 } 2283 2284 // CurrentLocalDescription returns the value of property "RTCPeerConnection.currentLocalDescription". 2285 // 2286 // It returns ok=false if there is no such property. 2287 func (this RTCPeerConnection) CurrentLocalDescription() (ret RTCSessionDescription, ok bool) { 2288 ok = js.True == bindings.GetRTCPeerConnectionCurrentLocalDescription( 2289 this.ref, js.Pointer(&ret), 2290 ) 2291 return 2292 } 2293 2294 // PendingLocalDescription returns the value of property "RTCPeerConnection.pendingLocalDescription". 2295 // 2296 // It returns ok=false if there is no such property. 2297 func (this RTCPeerConnection) PendingLocalDescription() (ret RTCSessionDescription, ok bool) { 2298 ok = js.True == bindings.GetRTCPeerConnectionPendingLocalDescription( 2299 this.ref, js.Pointer(&ret), 2300 ) 2301 return 2302 } 2303 2304 // RemoteDescription returns the value of property "RTCPeerConnection.remoteDescription". 2305 // 2306 // It returns ok=false if there is no such property. 2307 func (this RTCPeerConnection) RemoteDescription() (ret RTCSessionDescription, ok bool) { 2308 ok = js.True == bindings.GetRTCPeerConnectionRemoteDescription( 2309 this.ref, js.Pointer(&ret), 2310 ) 2311 return 2312 } 2313 2314 // CurrentRemoteDescription returns the value of property "RTCPeerConnection.currentRemoteDescription". 2315 // 2316 // It returns ok=false if there is no such property. 2317 func (this RTCPeerConnection) CurrentRemoteDescription() (ret RTCSessionDescription, ok bool) { 2318 ok = js.True == bindings.GetRTCPeerConnectionCurrentRemoteDescription( 2319 this.ref, js.Pointer(&ret), 2320 ) 2321 return 2322 } 2323 2324 // PendingRemoteDescription returns the value of property "RTCPeerConnection.pendingRemoteDescription". 2325 // 2326 // It returns ok=false if there is no such property. 2327 func (this RTCPeerConnection) PendingRemoteDescription() (ret RTCSessionDescription, ok bool) { 2328 ok = js.True == bindings.GetRTCPeerConnectionPendingRemoteDescription( 2329 this.ref, js.Pointer(&ret), 2330 ) 2331 return 2332 } 2333 2334 // SignalingState returns the value of property "RTCPeerConnection.signalingState". 2335 // 2336 // It returns ok=false if there is no such property. 2337 func (this RTCPeerConnection) SignalingState() (ret RTCSignalingState, ok bool) { 2338 ok = js.True == bindings.GetRTCPeerConnectionSignalingState( 2339 this.ref, js.Pointer(&ret), 2340 ) 2341 return 2342 } 2343 2344 // IceGatheringState returns the value of property "RTCPeerConnection.iceGatheringState". 2345 // 2346 // It returns ok=false if there is no such property. 2347 func (this RTCPeerConnection) IceGatheringState() (ret RTCIceGatheringState, ok bool) { 2348 ok = js.True == bindings.GetRTCPeerConnectionIceGatheringState( 2349 this.ref, js.Pointer(&ret), 2350 ) 2351 return 2352 } 2353 2354 // IceConnectionState returns the value of property "RTCPeerConnection.iceConnectionState". 2355 // 2356 // It returns ok=false if there is no such property. 2357 func (this RTCPeerConnection) IceConnectionState() (ret RTCIceConnectionState, ok bool) { 2358 ok = js.True == bindings.GetRTCPeerConnectionIceConnectionState( 2359 this.ref, js.Pointer(&ret), 2360 ) 2361 return 2362 } 2363 2364 // ConnectionState returns the value of property "RTCPeerConnection.connectionState". 2365 // 2366 // It returns ok=false if there is no such property. 2367 func (this RTCPeerConnection) ConnectionState() (ret RTCPeerConnectionState, ok bool) { 2368 ok = js.True == bindings.GetRTCPeerConnectionConnectionState( 2369 this.ref, js.Pointer(&ret), 2370 ) 2371 return 2372 } 2373 2374 // CanTrickleIceCandidates returns the value of property "RTCPeerConnection.canTrickleIceCandidates". 2375 // 2376 // It returns ok=false if there is no such property. 2377 func (this RTCPeerConnection) CanTrickleIceCandidates() (ret bool, ok bool) { 2378 ok = js.True == bindings.GetRTCPeerConnectionCanTrickleIceCandidates( 2379 this.ref, js.Pointer(&ret), 2380 ) 2381 return 2382 } 2383 2384 // Sctp returns the value of property "RTCPeerConnection.sctp". 2385 // 2386 // It returns ok=false if there is no such property. 2387 func (this RTCPeerConnection) Sctp() (ret RTCSctpTransport, ok bool) { 2388 ok = js.True == bindings.GetRTCPeerConnectionSctp( 2389 this.ref, js.Pointer(&ret), 2390 ) 2391 return 2392 } 2393 2394 // PeerIdentity returns the value of property "RTCPeerConnection.peerIdentity". 2395 // 2396 // It returns ok=false if there is no such property. 2397 func (this RTCPeerConnection) PeerIdentity() (ret js.Promise[RTCIdentityAssertion], ok bool) { 2398 ok = js.True == bindings.GetRTCPeerConnectionPeerIdentity( 2399 this.ref, js.Pointer(&ret), 2400 ) 2401 return 2402 } 2403 2404 // IdpLoginUrl returns the value of property "RTCPeerConnection.idpLoginUrl". 2405 // 2406 // It returns ok=false if there is no such property. 2407 func (this RTCPeerConnection) IdpLoginUrl() (ret js.String, ok bool) { 2408 ok = js.True == bindings.GetRTCPeerConnectionIdpLoginUrl( 2409 this.ref, js.Pointer(&ret), 2410 ) 2411 return 2412 } 2413 2414 // IdpErrorInfo returns the value of property "RTCPeerConnection.idpErrorInfo". 2415 // 2416 // It returns ok=false if there is no such property. 2417 func (this RTCPeerConnection) IdpErrorInfo() (ret js.String, ok bool) { 2418 ok = js.True == bindings.GetRTCPeerConnectionIdpErrorInfo( 2419 this.ref, js.Pointer(&ret), 2420 ) 2421 return 2422 } 2423 2424 // HasFuncCreateOffer returns true if the method "RTCPeerConnection.createOffer" exists. 2425 func (this RTCPeerConnection) HasFuncCreateOffer() bool { 2426 return js.True == bindings.HasFuncRTCPeerConnectionCreateOffer( 2427 this.ref, 2428 ) 2429 } 2430 2431 // FuncCreateOffer returns the method "RTCPeerConnection.createOffer". 2432 func (this RTCPeerConnection) FuncCreateOffer() (fn js.Func[func(options RTCOfferOptions) js.Promise[RTCSessionDescriptionInit]]) { 2433 bindings.FuncRTCPeerConnectionCreateOffer( 2434 this.ref, js.Pointer(&fn), 2435 ) 2436 return 2437 } 2438 2439 // CreateOffer calls the method "RTCPeerConnection.createOffer". 2440 func (this RTCPeerConnection) CreateOffer(options RTCOfferOptions) (ret js.Promise[RTCSessionDescriptionInit]) { 2441 bindings.CallRTCPeerConnectionCreateOffer( 2442 this.ref, js.Pointer(&ret), 2443 js.Pointer(&options), 2444 ) 2445 2446 return 2447 } 2448 2449 // TryCreateOffer calls the method "RTCPeerConnection.createOffer" 2450 // in a try/catch block and returns (_, err, ok = false) when it went through 2451 // the catch clause. 2452 func (this RTCPeerConnection) TryCreateOffer(options RTCOfferOptions) (ret js.Promise[RTCSessionDescriptionInit], exception js.Any, ok bool) { 2453 ok = js.True == bindings.TryRTCPeerConnectionCreateOffer( 2454 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2455 js.Pointer(&options), 2456 ) 2457 2458 return 2459 } 2460 2461 // HasFuncCreateOffer1 returns true if the method "RTCPeerConnection.createOffer" exists. 2462 func (this RTCPeerConnection) HasFuncCreateOffer1() bool { 2463 return js.True == bindings.HasFuncRTCPeerConnectionCreateOffer1( 2464 this.ref, 2465 ) 2466 } 2467 2468 // FuncCreateOffer1 returns the method "RTCPeerConnection.createOffer". 2469 func (this RTCPeerConnection) FuncCreateOffer1() (fn js.Func[func() js.Promise[RTCSessionDescriptionInit]]) { 2470 bindings.FuncRTCPeerConnectionCreateOffer1( 2471 this.ref, js.Pointer(&fn), 2472 ) 2473 return 2474 } 2475 2476 // CreateOffer1 calls the method "RTCPeerConnection.createOffer". 2477 func (this RTCPeerConnection) CreateOffer1() (ret js.Promise[RTCSessionDescriptionInit]) { 2478 bindings.CallRTCPeerConnectionCreateOffer1( 2479 this.ref, js.Pointer(&ret), 2480 ) 2481 2482 return 2483 } 2484 2485 // TryCreateOffer1 calls the method "RTCPeerConnection.createOffer" 2486 // in a try/catch block and returns (_, err, ok = false) when it went through 2487 // the catch clause. 2488 func (this RTCPeerConnection) TryCreateOffer1() (ret js.Promise[RTCSessionDescriptionInit], exception js.Any, ok bool) { 2489 ok = js.True == bindings.TryRTCPeerConnectionCreateOffer1( 2490 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2491 ) 2492 2493 return 2494 } 2495 2496 // HasFuncCreateAnswer returns true if the method "RTCPeerConnection.createAnswer" exists. 2497 func (this RTCPeerConnection) HasFuncCreateAnswer() bool { 2498 return js.True == bindings.HasFuncRTCPeerConnectionCreateAnswer( 2499 this.ref, 2500 ) 2501 } 2502 2503 // FuncCreateAnswer returns the method "RTCPeerConnection.createAnswer". 2504 func (this RTCPeerConnection) FuncCreateAnswer() (fn js.Func[func(options RTCAnswerOptions) js.Promise[RTCSessionDescriptionInit]]) { 2505 bindings.FuncRTCPeerConnectionCreateAnswer( 2506 this.ref, js.Pointer(&fn), 2507 ) 2508 return 2509 } 2510 2511 // CreateAnswer calls the method "RTCPeerConnection.createAnswer". 2512 func (this RTCPeerConnection) CreateAnswer(options RTCAnswerOptions) (ret js.Promise[RTCSessionDescriptionInit]) { 2513 bindings.CallRTCPeerConnectionCreateAnswer( 2514 this.ref, js.Pointer(&ret), 2515 js.Pointer(&options), 2516 ) 2517 2518 return 2519 } 2520 2521 // TryCreateAnswer calls the method "RTCPeerConnection.createAnswer" 2522 // in a try/catch block and returns (_, err, ok = false) when it went through 2523 // the catch clause. 2524 func (this RTCPeerConnection) TryCreateAnswer(options RTCAnswerOptions) (ret js.Promise[RTCSessionDescriptionInit], exception js.Any, ok bool) { 2525 ok = js.True == bindings.TryRTCPeerConnectionCreateAnswer( 2526 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2527 js.Pointer(&options), 2528 ) 2529 2530 return 2531 } 2532 2533 // HasFuncCreateAnswer1 returns true if the method "RTCPeerConnection.createAnswer" exists. 2534 func (this RTCPeerConnection) HasFuncCreateAnswer1() bool { 2535 return js.True == bindings.HasFuncRTCPeerConnectionCreateAnswer1( 2536 this.ref, 2537 ) 2538 } 2539 2540 // FuncCreateAnswer1 returns the method "RTCPeerConnection.createAnswer". 2541 func (this RTCPeerConnection) FuncCreateAnswer1() (fn js.Func[func() js.Promise[RTCSessionDescriptionInit]]) { 2542 bindings.FuncRTCPeerConnectionCreateAnswer1( 2543 this.ref, js.Pointer(&fn), 2544 ) 2545 return 2546 } 2547 2548 // CreateAnswer1 calls the method "RTCPeerConnection.createAnswer". 2549 func (this RTCPeerConnection) CreateAnswer1() (ret js.Promise[RTCSessionDescriptionInit]) { 2550 bindings.CallRTCPeerConnectionCreateAnswer1( 2551 this.ref, js.Pointer(&ret), 2552 ) 2553 2554 return 2555 } 2556 2557 // TryCreateAnswer1 calls the method "RTCPeerConnection.createAnswer" 2558 // in a try/catch block and returns (_, err, ok = false) when it went through 2559 // the catch clause. 2560 func (this RTCPeerConnection) TryCreateAnswer1() (ret js.Promise[RTCSessionDescriptionInit], exception js.Any, ok bool) { 2561 ok = js.True == bindings.TryRTCPeerConnectionCreateAnswer1( 2562 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2563 ) 2564 2565 return 2566 } 2567 2568 // HasFuncSetLocalDescription returns true if the method "RTCPeerConnection.setLocalDescription" exists. 2569 func (this RTCPeerConnection) HasFuncSetLocalDescription() bool { 2570 return js.True == bindings.HasFuncRTCPeerConnectionSetLocalDescription( 2571 this.ref, 2572 ) 2573 } 2574 2575 // FuncSetLocalDescription returns the method "RTCPeerConnection.setLocalDescription". 2576 func (this RTCPeerConnection) FuncSetLocalDescription() (fn js.Func[func(description RTCLocalSessionDescriptionInit) js.Promise[js.Void]]) { 2577 bindings.FuncRTCPeerConnectionSetLocalDescription( 2578 this.ref, js.Pointer(&fn), 2579 ) 2580 return 2581 } 2582 2583 // SetLocalDescription calls the method "RTCPeerConnection.setLocalDescription". 2584 func (this RTCPeerConnection) SetLocalDescription(description RTCLocalSessionDescriptionInit) (ret js.Promise[js.Void]) { 2585 bindings.CallRTCPeerConnectionSetLocalDescription( 2586 this.ref, js.Pointer(&ret), 2587 js.Pointer(&description), 2588 ) 2589 2590 return 2591 } 2592 2593 // TrySetLocalDescription calls the method "RTCPeerConnection.setLocalDescription" 2594 // in a try/catch block and returns (_, err, ok = false) when it went through 2595 // the catch clause. 2596 func (this RTCPeerConnection) TrySetLocalDescription(description RTCLocalSessionDescriptionInit) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2597 ok = js.True == bindings.TryRTCPeerConnectionSetLocalDescription( 2598 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2599 js.Pointer(&description), 2600 ) 2601 2602 return 2603 } 2604 2605 // HasFuncSetLocalDescription1 returns true if the method "RTCPeerConnection.setLocalDescription" exists. 2606 func (this RTCPeerConnection) HasFuncSetLocalDescription1() bool { 2607 return js.True == bindings.HasFuncRTCPeerConnectionSetLocalDescription1( 2608 this.ref, 2609 ) 2610 } 2611 2612 // FuncSetLocalDescription1 returns the method "RTCPeerConnection.setLocalDescription". 2613 func (this RTCPeerConnection) FuncSetLocalDescription1() (fn js.Func[func() js.Promise[js.Void]]) { 2614 bindings.FuncRTCPeerConnectionSetLocalDescription1( 2615 this.ref, js.Pointer(&fn), 2616 ) 2617 return 2618 } 2619 2620 // SetLocalDescription1 calls the method "RTCPeerConnection.setLocalDescription". 2621 func (this RTCPeerConnection) SetLocalDescription1() (ret js.Promise[js.Void]) { 2622 bindings.CallRTCPeerConnectionSetLocalDescription1( 2623 this.ref, js.Pointer(&ret), 2624 ) 2625 2626 return 2627 } 2628 2629 // TrySetLocalDescription1 calls the method "RTCPeerConnection.setLocalDescription" 2630 // in a try/catch block and returns (_, err, ok = false) when it went through 2631 // the catch clause. 2632 func (this RTCPeerConnection) TrySetLocalDescription1() (ret js.Promise[js.Void], exception js.Any, ok bool) { 2633 ok = js.True == bindings.TryRTCPeerConnectionSetLocalDescription1( 2634 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2635 ) 2636 2637 return 2638 } 2639 2640 // HasFuncSetRemoteDescription returns true if the method "RTCPeerConnection.setRemoteDescription" exists. 2641 func (this RTCPeerConnection) HasFuncSetRemoteDescription() bool { 2642 return js.True == bindings.HasFuncRTCPeerConnectionSetRemoteDescription( 2643 this.ref, 2644 ) 2645 } 2646 2647 // FuncSetRemoteDescription returns the method "RTCPeerConnection.setRemoteDescription". 2648 func (this RTCPeerConnection) FuncSetRemoteDescription() (fn js.Func[func(description RTCSessionDescriptionInit) js.Promise[js.Void]]) { 2649 bindings.FuncRTCPeerConnectionSetRemoteDescription( 2650 this.ref, js.Pointer(&fn), 2651 ) 2652 return 2653 } 2654 2655 // SetRemoteDescription calls the method "RTCPeerConnection.setRemoteDescription". 2656 func (this RTCPeerConnection) SetRemoteDescription(description RTCSessionDescriptionInit) (ret js.Promise[js.Void]) { 2657 bindings.CallRTCPeerConnectionSetRemoteDescription( 2658 this.ref, js.Pointer(&ret), 2659 js.Pointer(&description), 2660 ) 2661 2662 return 2663 } 2664 2665 // TrySetRemoteDescription calls the method "RTCPeerConnection.setRemoteDescription" 2666 // in a try/catch block and returns (_, err, ok = false) when it went through 2667 // the catch clause. 2668 func (this RTCPeerConnection) TrySetRemoteDescription(description RTCSessionDescriptionInit) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2669 ok = js.True == bindings.TryRTCPeerConnectionSetRemoteDescription( 2670 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2671 js.Pointer(&description), 2672 ) 2673 2674 return 2675 } 2676 2677 // HasFuncAddIceCandidate returns true if the method "RTCPeerConnection.addIceCandidate" exists. 2678 func (this RTCPeerConnection) HasFuncAddIceCandidate() bool { 2679 return js.True == bindings.HasFuncRTCPeerConnectionAddIceCandidate( 2680 this.ref, 2681 ) 2682 } 2683 2684 // FuncAddIceCandidate returns the method "RTCPeerConnection.addIceCandidate". 2685 func (this RTCPeerConnection) FuncAddIceCandidate() (fn js.Func[func(candidate RTCIceCandidateInit) js.Promise[js.Void]]) { 2686 bindings.FuncRTCPeerConnectionAddIceCandidate( 2687 this.ref, js.Pointer(&fn), 2688 ) 2689 return 2690 } 2691 2692 // AddIceCandidate calls the method "RTCPeerConnection.addIceCandidate". 2693 func (this RTCPeerConnection) AddIceCandidate(candidate RTCIceCandidateInit) (ret js.Promise[js.Void]) { 2694 bindings.CallRTCPeerConnectionAddIceCandidate( 2695 this.ref, js.Pointer(&ret), 2696 js.Pointer(&candidate), 2697 ) 2698 2699 return 2700 } 2701 2702 // TryAddIceCandidate calls the method "RTCPeerConnection.addIceCandidate" 2703 // in a try/catch block and returns (_, err, ok = false) when it went through 2704 // the catch clause. 2705 func (this RTCPeerConnection) TryAddIceCandidate(candidate RTCIceCandidateInit) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2706 ok = js.True == bindings.TryRTCPeerConnectionAddIceCandidate( 2707 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2708 js.Pointer(&candidate), 2709 ) 2710 2711 return 2712 } 2713 2714 // HasFuncAddIceCandidate1 returns true if the method "RTCPeerConnection.addIceCandidate" exists. 2715 func (this RTCPeerConnection) HasFuncAddIceCandidate1() bool { 2716 return js.True == bindings.HasFuncRTCPeerConnectionAddIceCandidate1( 2717 this.ref, 2718 ) 2719 } 2720 2721 // FuncAddIceCandidate1 returns the method "RTCPeerConnection.addIceCandidate". 2722 func (this RTCPeerConnection) FuncAddIceCandidate1() (fn js.Func[func() js.Promise[js.Void]]) { 2723 bindings.FuncRTCPeerConnectionAddIceCandidate1( 2724 this.ref, js.Pointer(&fn), 2725 ) 2726 return 2727 } 2728 2729 // AddIceCandidate1 calls the method "RTCPeerConnection.addIceCandidate". 2730 func (this RTCPeerConnection) AddIceCandidate1() (ret js.Promise[js.Void]) { 2731 bindings.CallRTCPeerConnectionAddIceCandidate1( 2732 this.ref, js.Pointer(&ret), 2733 ) 2734 2735 return 2736 } 2737 2738 // TryAddIceCandidate1 calls the method "RTCPeerConnection.addIceCandidate" 2739 // in a try/catch block and returns (_, err, ok = false) when it went through 2740 // the catch clause. 2741 func (this RTCPeerConnection) TryAddIceCandidate1() (ret js.Promise[js.Void], exception js.Any, ok bool) { 2742 ok = js.True == bindings.TryRTCPeerConnectionAddIceCandidate1( 2743 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2744 ) 2745 2746 return 2747 } 2748 2749 // HasFuncRestartIce returns true if the method "RTCPeerConnection.restartIce" exists. 2750 func (this RTCPeerConnection) HasFuncRestartIce() bool { 2751 return js.True == bindings.HasFuncRTCPeerConnectionRestartIce( 2752 this.ref, 2753 ) 2754 } 2755 2756 // FuncRestartIce returns the method "RTCPeerConnection.restartIce". 2757 func (this RTCPeerConnection) FuncRestartIce() (fn js.Func[func()]) { 2758 bindings.FuncRTCPeerConnectionRestartIce( 2759 this.ref, js.Pointer(&fn), 2760 ) 2761 return 2762 } 2763 2764 // RestartIce calls the method "RTCPeerConnection.restartIce". 2765 func (this RTCPeerConnection) RestartIce() (ret js.Void) { 2766 bindings.CallRTCPeerConnectionRestartIce( 2767 this.ref, js.Pointer(&ret), 2768 ) 2769 2770 return 2771 } 2772 2773 // TryRestartIce calls the method "RTCPeerConnection.restartIce" 2774 // in a try/catch block and returns (_, err, ok = false) when it went through 2775 // the catch clause. 2776 func (this RTCPeerConnection) TryRestartIce() (ret js.Void, exception js.Any, ok bool) { 2777 ok = js.True == bindings.TryRTCPeerConnectionRestartIce( 2778 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2779 ) 2780 2781 return 2782 } 2783 2784 // HasFuncGetConfiguration returns true if the method "RTCPeerConnection.getConfiguration" exists. 2785 func (this RTCPeerConnection) HasFuncGetConfiguration() bool { 2786 return js.True == bindings.HasFuncRTCPeerConnectionGetConfiguration( 2787 this.ref, 2788 ) 2789 } 2790 2791 // FuncGetConfiguration returns the method "RTCPeerConnection.getConfiguration". 2792 func (this RTCPeerConnection) FuncGetConfiguration() (fn js.Func[func() RTCConfiguration]) { 2793 bindings.FuncRTCPeerConnectionGetConfiguration( 2794 this.ref, js.Pointer(&fn), 2795 ) 2796 return 2797 } 2798 2799 // GetConfiguration calls the method "RTCPeerConnection.getConfiguration". 2800 func (this RTCPeerConnection) GetConfiguration() (ret RTCConfiguration) { 2801 bindings.CallRTCPeerConnectionGetConfiguration( 2802 this.ref, js.Pointer(&ret), 2803 ) 2804 2805 return 2806 } 2807 2808 // TryGetConfiguration calls the method "RTCPeerConnection.getConfiguration" 2809 // in a try/catch block and returns (_, err, ok = false) when it went through 2810 // the catch clause. 2811 func (this RTCPeerConnection) TryGetConfiguration() (ret RTCConfiguration, exception js.Any, ok bool) { 2812 ok = js.True == bindings.TryRTCPeerConnectionGetConfiguration( 2813 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2814 ) 2815 2816 return 2817 } 2818 2819 // HasFuncSetConfiguration returns true if the method "RTCPeerConnection.setConfiguration" exists. 2820 func (this RTCPeerConnection) HasFuncSetConfiguration() bool { 2821 return js.True == bindings.HasFuncRTCPeerConnectionSetConfiguration( 2822 this.ref, 2823 ) 2824 } 2825 2826 // FuncSetConfiguration returns the method "RTCPeerConnection.setConfiguration". 2827 func (this RTCPeerConnection) FuncSetConfiguration() (fn js.Func[func(configuration RTCConfiguration)]) { 2828 bindings.FuncRTCPeerConnectionSetConfiguration( 2829 this.ref, js.Pointer(&fn), 2830 ) 2831 return 2832 } 2833 2834 // SetConfiguration calls the method "RTCPeerConnection.setConfiguration". 2835 func (this RTCPeerConnection) SetConfiguration(configuration RTCConfiguration) (ret js.Void) { 2836 bindings.CallRTCPeerConnectionSetConfiguration( 2837 this.ref, js.Pointer(&ret), 2838 js.Pointer(&configuration), 2839 ) 2840 2841 return 2842 } 2843 2844 // TrySetConfiguration calls the method "RTCPeerConnection.setConfiguration" 2845 // in a try/catch block and returns (_, err, ok = false) when it went through 2846 // the catch clause. 2847 func (this RTCPeerConnection) TrySetConfiguration(configuration RTCConfiguration) (ret js.Void, exception js.Any, ok bool) { 2848 ok = js.True == bindings.TryRTCPeerConnectionSetConfiguration( 2849 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2850 js.Pointer(&configuration), 2851 ) 2852 2853 return 2854 } 2855 2856 // HasFuncSetConfiguration1 returns true if the method "RTCPeerConnection.setConfiguration" exists. 2857 func (this RTCPeerConnection) HasFuncSetConfiguration1() bool { 2858 return js.True == bindings.HasFuncRTCPeerConnectionSetConfiguration1( 2859 this.ref, 2860 ) 2861 } 2862 2863 // FuncSetConfiguration1 returns the method "RTCPeerConnection.setConfiguration". 2864 func (this RTCPeerConnection) FuncSetConfiguration1() (fn js.Func[func()]) { 2865 bindings.FuncRTCPeerConnectionSetConfiguration1( 2866 this.ref, js.Pointer(&fn), 2867 ) 2868 return 2869 } 2870 2871 // SetConfiguration1 calls the method "RTCPeerConnection.setConfiguration". 2872 func (this RTCPeerConnection) SetConfiguration1() (ret js.Void) { 2873 bindings.CallRTCPeerConnectionSetConfiguration1( 2874 this.ref, js.Pointer(&ret), 2875 ) 2876 2877 return 2878 } 2879 2880 // TrySetConfiguration1 calls the method "RTCPeerConnection.setConfiguration" 2881 // in a try/catch block and returns (_, err, ok = false) when it went through 2882 // the catch clause. 2883 func (this RTCPeerConnection) TrySetConfiguration1() (ret js.Void, exception js.Any, ok bool) { 2884 ok = js.True == bindings.TryRTCPeerConnectionSetConfiguration1( 2885 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2886 ) 2887 2888 return 2889 } 2890 2891 // HasFuncClose returns true if the method "RTCPeerConnection.close" exists. 2892 func (this RTCPeerConnection) HasFuncClose() bool { 2893 return js.True == bindings.HasFuncRTCPeerConnectionClose( 2894 this.ref, 2895 ) 2896 } 2897 2898 // FuncClose returns the method "RTCPeerConnection.close". 2899 func (this RTCPeerConnection) FuncClose() (fn js.Func[func()]) { 2900 bindings.FuncRTCPeerConnectionClose( 2901 this.ref, js.Pointer(&fn), 2902 ) 2903 return 2904 } 2905 2906 // Close calls the method "RTCPeerConnection.close". 2907 func (this RTCPeerConnection) Close() (ret js.Void) { 2908 bindings.CallRTCPeerConnectionClose( 2909 this.ref, js.Pointer(&ret), 2910 ) 2911 2912 return 2913 } 2914 2915 // TryClose calls the method "RTCPeerConnection.close" 2916 // in a try/catch block and returns (_, err, ok = false) when it went through 2917 // the catch clause. 2918 func (this RTCPeerConnection) TryClose() (ret js.Void, exception js.Any, ok bool) { 2919 ok = js.True == bindings.TryRTCPeerConnectionClose( 2920 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2921 ) 2922 2923 return 2924 } 2925 2926 // HasFuncCreateOffer2 returns true if the method "RTCPeerConnection.createOffer" exists. 2927 func (this RTCPeerConnection) HasFuncCreateOffer2() bool { 2928 return js.True == bindings.HasFuncRTCPeerConnectionCreateOffer2( 2929 this.ref, 2930 ) 2931 } 2932 2933 // FuncCreateOffer2 returns the method "RTCPeerConnection.createOffer". 2934 func (this RTCPeerConnection) FuncCreateOffer2() (fn js.Func[func(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)], options RTCOfferOptions) js.Promise[js.Void]]) { 2935 bindings.FuncRTCPeerConnectionCreateOffer2( 2936 this.ref, js.Pointer(&fn), 2937 ) 2938 return 2939 } 2940 2941 // CreateOffer2 calls the method "RTCPeerConnection.createOffer". 2942 func (this RTCPeerConnection) CreateOffer2(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)], options RTCOfferOptions) (ret js.Promise[js.Void]) { 2943 bindings.CallRTCPeerConnectionCreateOffer2( 2944 this.ref, js.Pointer(&ret), 2945 successCallback.Ref(), 2946 failureCallback.Ref(), 2947 js.Pointer(&options), 2948 ) 2949 2950 return 2951 } 2952 2953 // TryCreateOffer2 calls the method "RTCPeerConnection.createOffer" 2954 // in a try/catch block and returns (_, err, ok = false) when it went through 2955 // the catch clause. 2956 func (this RTCPeerConnection) TryCreateOffer2(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)], options RTCOfferOptions) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2957 ok = js.True == bindings.TryRTCPeerConnectionCreateOffer2( 2958 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2959 successCallback.Ref(), 2960 failureCallback.Ref(), 2961 js.Pointer(&options), 2962 ) 2963 2964 return 2965 } 2966 2967 // HasFuncCreateOffer3 returns true if the method "RTCPeerConnection.createOffer" exists. 2968 func (this RTCPeerConnection) HasFuncCreateOffer3() bool { 2969 return js.True == bindings.HasFuncRTCPeerConnectionCreateOffer3( 2970 this.ref, 2971 ) 2972 } 2973 2974 // FuncCreateOffer3 returns the method "RTCPeerConnection.createOffer". 2975 func (this RTCPeerConnection) FuncCreateOffer3() (fn js.Func[func(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)]) js.Promise[js.Void]]) { 2976 bindings.FuncRTCPeerConnectionCreateOffer3( 2977 this.ref, js.Pointer(&fn), 2978 ) 2979 return 2980 } 2981 2982 // CreateOffer3 calls the method "RTCPeerConnection.createOffer". 2983 func (this RTCPeerConnection) CreateOffer3(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void]) { 2984 bindings.CallRTCPeerConnectionCreateOffer3( 2985 this.ref, js.Pointer(&ret), 2986 successCallback.Ref(), 2987 failureCallback.Ref(), 2988 ) 2989 2990 return 2991 } 2992 2993 // TryCreateOffer3 calls the method "RTCPeerConnection.createOffer" 2994 // in a try/catch block and returns (_, err, ok = false) when it went through 2995 // the catch clause. 2996 func (this RTCPeerConnection) TryCreateOffer3(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 2997 ok = js.True == bindings.TryRTCPeerConnectionCreateOffer3( 2998 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2999 successCallback.Ref(), 3000 failureCallback.Ref(), 3001 ) 3002 3003 return 3004 } 3005 3006 // HasFuncSetLocalDescription2 returns true if the method "RTCPeerConnection.setLocalDescription" exists. 3007 func (this RTCPeerConnection) HasFuncSetLocalDescription2() bool { 3008 return js.True == bindings.HasFuncRTCPeerConnectionSetLocalDescription2( 3009 this.ref, 3010 ) 3011 } 3012 3013 // FuncSetLocalDescription2 returns the method "RTCPeerConnection.setLocalDescription". 3014 func (this RTCPeerConnection) FuncSetLocalDescription2() (fn js.Func[func(description RTCLocalSessionDescriptionInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) js.Promise[js.Void]]) { 3015 bindings.FuncRTCPeerConnectionSetLocalDescription2( 3016 this.ref, js.Pointer(&fn), 3017 ) 3018 return 3019 } 3020 3021 // SetLocalDescription2 calls the method "RTCPeerConnection.setLocalDescription". 3022 func (this RTCPeerConnection) SetLocalDescription2(description RTCLocalSessionDescriptionInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void]) { 3023 bindings.CallRTCPeerConnectionSetLocalDescription2( 3024 this.ref, js.Pointer(&ret), 3025 js.Pointer(&description), 3026 successCallback.Ref(), 3027 failureCallback.Ref(), 3028 ) 3029 3030 return 3031 } 3032 3033 // TrySetLocalDescription2 calls the method "RTCPeerConnection.setLocalDescription" 3034 // in a try/catch block and returns (_, err, ok = false) when it went through 3035 // the catch clause. 3036 func (this RTCPeerConnection) TrySetLocalDescription2(description RTCLocalSessionDescriptionInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 3037 ok = js.True == bindings.TryRTCPeerConnectionSetLocalDescription2( 3038 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3039 js.Pointer(&description), 3040 successCallback.Ref(), 3041 failureCallback.Ref(), 3042 ) 3043 3044 return 3045 } 3046 3047 // HasFuncCreateAnswer2 returns true if the method "RTCPeerConnection.createAnswer" exists. 3048 func (this RTCPeerConnection) HasFuncCreateAnswer2() bool { 3049 return js.True == bindings.HasFuncRTCPeerConnectionCreateAnswer2( 3050 this.ref, 3051 ) 3052 } 3053 3054 // FuncCreateAnswer2 returns the method "RTCPeerConnection.createAnswer". 3055 func (this RTCPeerConnection) FuncCreateAnswer2() (fn js.Func[func(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)]) js.Promise[js.Void]]) { 3056 bindings.FuncRTCPeerConnectionCreateAnswer2( 3057 this.ref, js.Pointer(&fn), 3058 ) 3059 return 3060 } 3061 3062 // CreateAnswer2 calls the method "RTCPeerConnection.createAnswer". 3063 func (this RTCPeerConnection) CreateAnswer2(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void]) { 3064 bindings.CallRTCPeerConnectionCreateAnswer2( 3065 this.ref, js.Pointer(&ret), 3066 successCallback.Ref(), 3067 failureCallback.Ref(), 3068 ) 3069 3070 return 3071 } 3072 3073 // TryCreateAnswer2 calls the method "RTCPeerConnection.createAnswer" 3074 // in a try/catch block and returns (_, err, ok = false) when it went through 3075 // the catch clause. 3076 func (this RTCPeerConnection) TryCreateAnswer2(successCallback js.Func[func(description *RTCSessionDescriptionInit)], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 3077 ok = js.True == bindings.TryRTCPeerConnectionCreateAnswer2( 3078 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3079 successCallback.Ref(), 3080 failureCallback.Ref(), 3081 ) 3082 3083 return 3084 } 3085 3086 // HasFuncSetRemoteDescription1 returns true if the method "RTCPeerConnection.setRemoteDescription" exists. 3087 func (this RTCPeerConnection) HasFuncSetRemoteDescription1() bool { 3088 return js.True == bindings.HasFuncRTCPeerConnectionSetRemoteDescription1( 3089 this.ref, 3090 ) 3091 } 3092 3093 // FuncSetRemoteDescription1 returns the method "RTCPeerConnection.setRemoteDescription". 3094 func (this RTCPeerConnection) FuncSetRemoteDescription1() (fn js.Func[func(description RTCSessionDescriptionInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) js.Promise[js.Void]]) { 3095 bindings.FuncRTCPeerConnectionSetRemoteDescription1( 3096 this.ref, js.Pointer(&fn), 3097 ) 3098 return 3099 } 3100 3101 // SetRemoteDescription1 calls the method "RTCPeerConnection.setRemoteDescription". 3102 func (this RTCPeerConnection) SetRemoteDescription1(description RTCSessionDescriptionInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void]) { 3103 bindings.CallRTCPeerConnectionSetRemoteDescription1( 3104 this.ref, js.Pointer(&ret), 3105 js.Pointer(&description), 3106 successCallback.Ref(), 3107 failureCallback.Ref(), 3108 ) 3109 3110 return 3111 } 3112 3113 // TrySetRemoteDescription1 calls the method "RTCPeerConnection.setRemoteDescription" 3114 // in a try/catch block and returns (_, err, ok = false) when it went through 3115 // the catch clause. 3116 func (this RTCPeerConnection) TrySetRemoteDescription1(description RTCSessionDescriptionInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 3117 ok = js.True == bindings.TryRTCPeerConnectionSetRemoteDescription1( 3118 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3119 js.Pointer(&description), 3120 successCallback.Ref(), 3121 failureCallback.Ref(), 3122 ) 3123 3124 return 3125 } 3126 3127 // HasFuncAddIceCandidate2 returns true if the method "RTCPeerConnection.addIceCandidate" exists. 3128 func (this RTCPeerConnection) HasFuncAddIceCandidate2() bool { 3129 return js.True == bindings.HasFuncRTCPeerConnectionAddIceCandidate2( 3130 this.ref, 3131 ) 3132 } 3133 3134 // FuncAddIceCandidate2 returns the method "RTCPeerConnection.addIceCandidate". 3135 func (this RTCPeerConnection) FuncAddIceCandidate2() (fn js.Func[func(candidate RTCIceCandidateInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) js.Promise[js.Void]]) { 3136 bindings.FuncRTCPeerConnectionAddIceCandidate2( 3137 this.ref, js.Pointer(&fn), 3138 ) 3139 return 3140 } 3141 3142 // AddIceCandidate2 calls the method "RTCPeerConnection.addIceCandidate". 3143 func (this RTCPeerConnection) AddIceCandidate2(candidate RTCIceCandidateInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void]) { 3144 bindings.CallRTCPeerConnectionAddIceCandidate2( 3145 this.ref, js.Pointer(&ret), 3146 js.Pointer(&candidate), 3147 successCallback.Ref(), 3148 failureCallback.Ref(), 3149 ) 3150 3151 return 3152 } 3153 3154 // TryAddIceCandidate2 calls the method "RTCPeerConnection.addIceCandidate" 3155 // in a try/catch block and returns (_, err, ok = false) when it went through 3156 // the catch clause. 3157 func (this RTCPeerConnection) TryAddIceCandidate2(candidate RTCIceCandidateInit, successCallback js.Func[func()], failureCallback js.Func[func(err DOMException)]) (ret js.Promise[js.Void], exception js.Any, ok bool) { 3158 ok = js.True == bindings.TryRTCPeerConnectionAddIceCandidate2( 3159 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3160 js.Pointer(&candidate), 3161 successCallback.Ref(), 3162 failureCallback.Ref(), 3163 ) 3164 3165 return 3166 } 3167 3168 // HasFuncCreateDataChannel returns true if the method "RTCPeerConnection.createDataChannel" exists. 3169 func (this RTCPeerConnection) HasFuncCreateDataChannel() bool { 3170 return js.True == bindings.HasFuncRTCPeerConnectionCreateDataChannel( 3171 this.ref, 3172 ) 3173 } 3174 3175 // FuncCreateDataChannel returns the method "RTCPeerConnection.createDataChannel". 3176 func (this RTCPeerConnection) FuncCreateDataChannel() (fn js.Func[func(label js.String, dataChannelDict RTCDataChannelInit) RTCDataChannel]) { 3177 bindings.FuncRTCPeerConnectionCreateDataChannel( 3178 this.ref, js.Pointer(&fn), 3179 ) 3180 return 3181 } 3182 3183 // CreateDataChannel calls the method "RTCPeerConnection.createDataChannel". 3184 func (this RTCPeerConnection) CreateDataChannel(label js.String, dataChannelDict RTCDataChannelInit) (ret RTCDataChannel) { 3185 bindings.CallRTCPeerConnectionCreateDataChannel( 3186 this.ref, js.Pointer(&ret), 3187 label.Ref(), 3188 js.Pointer(&dataChannelDict), 3189 ) 3190 3191 return 3192 } 3193 3194 // TryCreateDataChannel calls the method "RTCPeerConnection.createDataChannel" 3195 // in a try/catch block and returns (_, err, ok = false) when it went through 3196 // the catch clause. 3197 func (this RTCPeerConnection) TryCreateDataChannel(label js.String, dataChannelDict RTCDataChannelInit) (ret RTCDataChannel, exception js.Any, ok bool) { 3198 ok = js.True == bindings.TryRTCPeerConnectionCreateDataChannel( 3199 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3200 label.Ref(), 3201 js.Pointer(&dataChannelDict), 3202 ) 3203 3204 return 3205 } 3206 3207 // HasFuncCreateDataChannel1 returns true if the method "RTCPeerConnection.createDataChannel" exists. 3208 func (this RTCPeerConnection) HasFuncCreateDataChannel1() bool { 3209 return js.True == bindings.HasFuncRTCPeerConnectionCreateDataChannel1( 3210 this.ref, 3211 ) 3212 } 3213 3214 // FuncCreateDataChannel1 returns the method "RTCPeerConnection.createDataChannel". 3215 func (this RTCPeerConnection) FuncCreateDataChannel1() (fn js.Func[func(label js.String) RTCDataChannel]) { 3216 bindings.FuncRTCPeerConnectionCreateDataChannel1( 3217 this.ref, js.Pointer(&fn), 3218 ) 3219 return 3220 } 3221 3222 // CreateDataChannel1 calls the method "RTCPeerConnection.createDataChannel". 3223 func (this RTCPeerConnection) CreateDataChannel1(label js.String) (ret RTCDataChannel) { 3224 bindings.CallRTCPeerConnectionCreateDataChannel1( 3225 this.ref, js.Pointer(&ret), 3226 label.Ref(), 3227 ) 3228 3229 return 3230 } 3231 3232 // TryCreateDataChannel1 calls the method "RTCPeerConnection.createDataChannel" 3233 // in a try/catch block and returns (_, err, ok = false) when it went through 3234 // the catch clause. 3235 func (this RTCPeerConnection) TryCreateDataChannel1(label js.String) (ret RTCDataChannel, exception js.Any, ok bool) { 3236 ok = js.True == bindings.TryRTCPeerConnectionCreateDataChannel1( 3237 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3238 label.Ref(), 3239 ) 3240 3241 return 3242 } 3243 3244 // HasFuncGetSenders returns true if the method "RTCPeerConnection.getSenders" exists. 3245 func (this RTCPeerConnection) HasFuncGetSenders() bool { 3246 return js.True == bindings.HasFuncRTCPeerConnectionGetSenders( 3247 this.ref, 3248 ) 3249 } 3250 3251 // FuncGetSenders returns the method "RTCPeerConnection.getSenders". 3252 func (this RTCPeerConnection) FuncGetSenders() (fn js.Func[func() js.Array[RTCRtpSender]]) { 3253 bindings.FuncRTCPeerConnectionGetSenders( 3254 this.ref, js.Pointer(&fn), 3255 ) 3256 return 3257 } 3258 3259 // GetSenders calls the method "RTCPeerConnection.getSenders". 3260 func (this RTCPeerConnection) GetSenders() (ret js.Array[RTCRtpSender]) { 3261 bindings.CallRTCPeerConnectionGetSenders( 3262 this.ref, js.Pointer(&ret), 3263 ) 3264 3265 return 3266 } 3267 3268 // TryGetSenders calls the method "RTCPeerConnection.getSenders" 3269 // in a try/catch block and returns (_, err, ok = false) when it went through 3270 // the catch clause. 3271 func (this RTCPeerConnection) TryGetSenders() (ret js.Array[RTCRtpSender], exception js.Any, ok bool) { 3272 ok = js.True == bindings.TryRTCPeerConnectionGetSenders( 3273 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3274 ) 3275 3276 return 3277 } 3278 3279 // HasFuncGetReceivers returns true if the method "RTCPeerConnection.getReceivers" exists. 3280 func (this RTCPeerConnection) HasFuncGetReceivers() bool { 3281 return js.True == bindings.HasFuncRTCPeerConnectionGetReceivers( 3282 this.ref, 3283 ) 3284 } 3285 3286 // FuncGetReceivers returns the method "RTCPeerConnection.getReceivers". 3287 func (this RTCPeerConnection) FuncGetReceivers() (fn js.Func[func() js.Array[RTCRtpReceiver]]) { 3288 bindings.FuncRTCPeerConnectionGetReceivers( 3289 this.ref, js.Pointer(&fn), 3290 ) 3291 return 3292 } 3293 3294 // GetReceivers calls the method "RTCPeerConnection.getReceivers". 3295 func (this RTCPeerConnection) GetReceivers() (ret js.Array[RTCRtpReceiver]) { 3296 bindings.CallRTCPeerConnectionGetReceivers( 3297 this.ref, js.Pointer(&ret), 3298 ) 3299 3300 return 3301 } 3302 3303 // TryGetReceivers calls the method "RTCPeerConnection.getReceivers" 3304 // in a try/catch block and returns (_, err, ok = false) when it went through 3305 // the catch clause. 3306 func (this RTCPeerConnection) TryGetReceivers() (ret js.Array[RTCRtpReceiver], exception js.Any, ok bool) { 3307 ok = js.True == bindings.TryRTCPeerConnectionGetReceivers( 3308 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3309 ) 3310 3311 return 3312 } 3313 3314 // HasFuncGetTransceivers returns true if the method "RTCPeerConnection.getTransceivers" exists. 3315 func (this RTCPeerConnection) HasFuncGetTransceivers() bool { 3316 return js.True == bindings.HasFuncRTCPeerConnectionGetTransceivers( 3317 this.ref, 3318 ) 3319 } 3320 3321 // FuncGetTransceivers returns the method "RTCPeerConnection.getTransceivers". 3322 func (this RTCPeerConnection) FuncGetTransceivers() (fn js.Func[func() js.Array[RTCRtpTransceiver]]) { 3323 bindings.FuncRTCPeerConnectionGetTransceivers( 3324 this.ref, js.Pointer(&fn), 3325 ) 3326 return 3327 } 3328 3329 // GetTransceivers calls the method "RTCPeerConnection.getTransceivers". 3330 func (this RTCPeerConnection) GetTransceivers() (ret js.Array[RTCRtpTransceiver]) { 3331 bindings.CallRTCPeerConnectionGetTransceivers( 3332 this.ref, js.Pointer(&ret), 3333 ) 3334 3335 return 3336 } 3337 3338 // TryGetTransceivers calls the method "RTCPeerConnection.getTransceivers" 3339 // in a try/catch block and returns (_, err, ok = false) when it went through 3340 // the catch clause. 3341 func (this RTCPeerConnection) TryGetTransceivers() (ret js.Array[RTCRtpTransceiver], exception js.Any, ok bool) { 3342 ok = js.True == bindings.TryRTCPeerConnectionGetTransceivers( 3343 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3344 ) 3345 3346 return 3347 } 3348 3349 // HasFuncAddTrack returns true if the method "RTCPeerConnection.addTrack" exists. 3350 func (this RTCPeerConnection) HasFuncAddTrack() bool { 3351 return js.True == bindings.HasFuncRTCPeerConnectionAddTrack( 3352 this.ref, 3353 ) 3354 } 3355 3356 // FuncAddTrack returns the method "RTCPeerConnection.addTrack". 3357 func (this RTCPeerConnection) FuncAddTrack() (fn js.Func[func(track MediaStreamTrack, streams ...MediaStream) RTCRtpSender]) { 3358 bindings.FuncRTCPeerConnectionAddTrack( 3359 this.ref, js.Pointer(&fn), 3360 ) 3361 return 3362 } 3363 3364 // AddTrack calls the method "RTCPeerConnection.addTrack". 3365 func (this RTCPeerConnection) AddTrack(track MediaStreamTrack, streams ...MediaStream) (ret RTCRtpSender) { 3366 bindings.CallRTCPeerConnectionAddTrack( 3367 this.ref, js.Pointer(&ret), 3368 track.Ref(), 3369 js.SliceData(streams), 3370 js.SizeU(len(streams)), 3371 ) 3372 3373 return 3374 } 3375 3376 // TryAddTrack calls the method "RTCPeerConnection.addTrack" 3377 // in a try/catch block and returns (_, err, ok = false) when it went through 3378 // the catch clause. 3379 func (this RTCPeerConnection) TryAddTrack(track MediaStreamTrack, streams ...MediaStream) (ret RTCRtpSender, exception js.Any, ok bool) { 3380 ok = js.True == bindings.TryRTCPeerConnectionAddTrack( 3381 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3382 track.Ref(), 3383 js.SliceData(streams), 3384 js.SizeU(len(streams)), 3385 ) 3386 3387 return 3388 } 3389 3390 // HasFuncRemoveTrack returns true if the method "RTCPeerConnection.removeTrack" exists. 3391 func (this RTCPeerConnection) HasFuncRemoveTrack() bool { 3392 return js.True == bindings.HasFuncRTCPeerConnectionRemoveTrack( 3393 this.ref, 3394 ) 3395 } 3396 3397 // FuncRemoveTrack returns the method "RTCPeerConnection.removeTrack". 3398 func (this RTCPeerConnection) FuncRemoveTrack() (fn js.Func[func(sender RTCRtpSender)]) { 3399 bindings.FuncRTCPeerConnectionRemoveTrack( 3400 this.ref, js.Pointer(&fn), 3401 ) 3402 return 3403 } 3404 3405 // RemoveTrack calls the method "RTCPeerConnection.removeTrack". 3406 func (this RTCPeerConnection) RemoveTrack(sender RTCRtpSender) (ret js.Void) { 3407 bindings.CallRTCPeerConnectionRemoveTrack( 3408 this.ref, js.Pointer(&ret), 3409 sender.Ref(), 3410 ) 3411 3412 return 3413 } 3414 3415 // TryRemoveTrack calls the method "RTCPeerConnection.removeTrack" 3416 // in a try/catch block and returns (_, err, ok = false) when it went through 3417 // the catch clause. 3418 func (this RTCPeerConnection) TryRemoveTrack(sender RTCRtpSender) (ret js.Void, exception js.Any, ok bool) { 3419 ok = js.True == bindings.TryRTCPeerConnectionRemoveTrack( 3420 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3421 sender.Ref(), 3422 ) 3423 3424 return 3425 } 3426 3427 // HasFuncAddTransceiver returns true if the method "RTCPeerConnection.addTransceiver" exists. 3428 func (this RTCPeerConnection) HasFuncAddTransceiver() bool { 3429 return js.True == bindings.HasFuncRTCPeerConnectionAddTransceiver( 3430 this.ref, 3431 ) 3432 } 3433 3434 // FuncAddTransceiver returns the method "RTCPeerConnection.addTransceiver". 3435 func (this RTCPeerConnection) FuncAddTransceiver() (fn js.Func[func(trackOrKind OneOf_MediaStreamTrack_String, init RTCRtpTransceiverInit) RTCRtpTransceiver]) { 3436 bindings.FuncRTCPeerConnectionAddTransceiver( 3437 this.ref, js.Pointer(&fn), 3438 ) 3439 return 3440 } 3441 3442 // AddTransceiver calls the method "RTCPeerConnection.addTransceiver". 3443 func (this RTCPeerConnection) AddTransceiver(trackOrKind OneOf_MediaStreamTrack_String, init RTCRtpTransceiverInit) (ret RTCRtpTransceiver) { 3444 bindings.CallRTCPeerConnectionAddTransceiver( 3445 this.ref, js.Pointer(&ret), 3446 trackOrKind.Ref(), 3447 js.Pointer(&init), 3448 ) 3449 3450 return 3451 } 3452 3453 // TryAddTransceiver calls the method "RTCPeerConnection.addTransceiver" 3454 // in a try/catch block and returns (_, err, ok = false) when it went through 3455 // the catch clause. 3456 func (this RTCPeerConnection) TryAddTransceiver(trackOrKind OneOf_MediaStreamTrack_String, init RTCRtpTransceiverInit) (ret RTCRtpTransceiver, exception js.Any, ok bool) { 3457 ok = js.True == bindings.TryRTCPeerConnectionAddTransceiver( 3458 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3459 trackOrKind.Ref(), 3460 js.Pointer(&init), 3461 ) 3462 3463 return 3464 } 3465 3466 // HasFuncAddTransceiver1 returns true if the method "RTCPeerConnection.addTransceiver" exists. 3467 func (this RTCPeerConnection) HasFuncAddTransceiver1() bool { 3468 return js.True == bindings.HasFuncRTCPeerConnectionAddTransceiver1( 3469 this.ref, 3470 ) 3471 } 3472 3473 // FuncAddTransceiver1 returns the method "RTCPeerConnection.addTransceiver". 3474 func (this RTCPeerConnection) FuncAddTransceiver1() (fn js.Func[func(trackOrKind OneOf_MediaStreamTrack_String) RTCRtpTransceiver]) { 3475 bindings.FuncRTCPeerConnectionAddTransceiver1( 3476 this.ref, js.Pointer(&fn), 3477 ) 3478 return 3479 } 3480 3481 // AddTransceiver1 calls the method "RTCPeerConnection.addTransceiver". 3482 func (this RTCPeerConnection) AddTransceiver1(trackOrKind OneOf_MediaStreamTrack_String) (ret RTCRtpTransceiver) { 3483 bindings.CallRTCPeerConnectionAddTransceiver1( 3484 this.ref, js.Pointer(&ret), 3485 trackOrKind.Ref(), 3486 ) 3487 3488 return 3489 } 3490 3491 // TryAddTransceiver1 calls the method "RTCPeerConnection.addTransceiver" 3492 // in a try/catch block and returns (_, err, ok = false) when it went through 3493 // the catch clause. 3494 func (this RTCPeerConnection) TryAddTransceiver1(trackOrKind OneOf_MediaStreamTrack_String) (ret RTCRtpTransceiver, exception js.Any, ok bool) { 3495 ok = js.True == bindings.TryRTCPeerConnectionAddTransceiver1( 3496 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3497 trackOrKind.Ref(), 3498 ) 3499 3500 return 3501 } 3502 3503 // HasFuncGetStats returns true if the method "RTCPeerConnection.getStats" exists. 3504 func (this RTCPeerConnection) HasFuncGetStats() bool { 3505 return js.True == bindings.HasFuncRTCPeerConnectionGetStats( 3506 this.ref, 3507 ) 3508 } 3509 3510 // FuncGetStats returns the method "RTCPeerConnection.getStats". 3511 func (this RTCPeerConnection) FuncGetStats() (fn js.Func[func(selector MediaStreamTrack) js.Promise[RTCStatsReport]]) { 3512 bindings.FuncRTCPeerConnectionGetStats( 3513 this.ref, js.Pointer(&fn), 3514 ) 3515 return 3516 } 3517 3518 // GetStats calls the method "RTCPeerConnection.getStats". 3519 func (this RTCPeerConnection) GetStats(selector MediaStreamTrack) (ret js.Promise[RTCStatsReport]) { 3520 bindings.CallRTCPeerConnectionGetStats( 3521 this.ref, js.Pointer(&ret), 3522 selector.Ref(), 3523 ) 3524 3525 return 3526 } 3527 3528 // TryGetStats calls the method "RTCPeerConnection.getStats" 3529 // in a try/catch block and returns (_, err, ok = false) when it went through 3530 // the catch clause. 3531 func (this RTCPeerConnection) TryGetStats(selector MediaStreamTrack) (ret js.Promise[RTCStatsReport], exception js.Any, ok bool) { 3532 ok = js.True == bindings.TryRTCPeerConnectionGetStats( 3533 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3534 selector.Ref(), 3535 ) 3536 3537 return 3538 } 3539 3540 // HasFuncGetStats1 returns true if the method "RTCPeerConnection.getStats" exists. 3541 func (this RTCPeerConnection) HasFuncGetStats1() bool { 3542 return js.True == bindings.HasFuncRTCPeerConnectionGetStats1( 3543 this.ref, 3544 ) 3545 } 3546 3547 // FuncGetStats1 returns the method "RTCPeerConnection.getStats". 3548 func (this RTCPeerConnection) FuncGetStats1() (fn js.Func[func() js.Promise[RTCStatsReport]]) { 3549 bindings.FuncRTCPeerConnectionGetStats1( 3550 this.ref, js.Pointer(&fn), 3551 ) 3552 return 3553 } 3554 3555 // GetStats1 calls the method "RTCPeerConnection.getStats". 3556 func (this RTCPeerConnection) GetStats1() (ret js.Promise[RTCStatsReport]) { 3557 bindings.CallRTCPeerConnectionGetStats1( 3558 this.ref, js.Pointer(&ret), 3559 ) 3560 3561 return 3562 } 3563 3564 // TryGetStats1 calls the method "RTCPeerConnection.getStats" 3565 // in a try/catch block and returns (_, err, ok = false) when it went through 3566 // the catch clause. 3567 func (this RTCPeerConnection) TryGetStats1() (ret js.Promise[RTCStatsReport], exception js.Any, ok bool) { 3568 ok = js.True == bindings.TryRTCPeerConnectionGetStats1( 3569 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3570 ) 3571 3572 return 3573 } 3574 3575 // HasFuncGenerateCertificate returns true if the static method "RTCPeerConnection.generateCertificate" exists. 3576 func (this RTCPeerConnection) HasFuncGenerateCertificate() bool { 3577 return js.True == bindings.HasFuncRTCPeerConnectionGenerateCertificate( 3578 this.ref, 3579 ) 3580 } 3581 3582 // FuncGenerateCertificate returns the static method "RTCPeerConnection.generateCertificate". 3583 func (this RTCPeerConnection) FuncGenerateCertificate() (fn js.Func[func(keygenAlgorithm AlgorithmIdentifier) js.Promise[RTCCertificate]]) { 3584 bindings.FuncRTCPeerConnectionGenerateCertificate( 3585 this.ref, js.Pointer(&fn), 3586 ) 3587 return 3588 } 3589 3590 // GenerateCertificate calls the static method "RTCPeerConnection.generateCertificate". 3591 func (this RTCPeerConnection) GenerateCertificate(keygenAlgorithm AlgorithmIdentifier) (ret js.Promise[RTCCertificate]) { 3592 bindings.CallRTCPeerConnectionGenerateCertificate( 3593 this.ref, js.Pointer(&ret), 3594 keygenAlgorithm.Ref(), 3595 ) 3596 3597 return 3598 } 3599 3600 // TryGenerateCertificate calls the static method "RTCPeerConnection.generateCertificate" 3601 // in a try/catch block and returns (_, err, ok = false) when it went through 3602 // the catch clause. 3603 func (this RTCPeerConnection) TryGenerateCertificate(keygenAlgorithm AlgorithmIdentifier) (ret js.Promise[RTCCertificate], exception js.Any, ok bool) { 3604 ok = js.True == bindings.TryRTCPeerConnectionGenerateCertificate( 3605 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3606 keygenAlgorithm.Ref(), 3607 ) 3608 3609 return 3610 } 3611 3612 // HasFuncSetIdentityProvider returns true if the method "RTCPeerConnection.setIdentityProvider" exists. 3613 func (this RTCPeerConnection) HasFuncSetIdentityProvider() bool { 3614 return js.True == bindings.HasFuncRTCPeerConnectionSetIdentityProvider( 3615 this.ref, 3616 ) 3617 } 3618 3619 // FuncSetIdentityProvider returns the method "RTCPeerConnection.setIdentityProvider". 3620 func (this RTCPeerConnection) FuncSetIdentityProvider() (fn js.Func[func(provider js.String, options RTCIdentityProviderOptions)]) { 3621 bindings.FuncRTCPeerConnectionSetIdentityProvider( 3622 this.ref, js.Pointer(&fn), 3623 ) 3624 return 3625 } 3626 3627 // SetIdentityProvider calls the method "RTCPeerConnection.setIdentityProvider". 3628 func (this RTCPeerConnection) SetIdentityProvider(provider js.String, options RTCIdentityProviderOptions) (ret js.Void) { 3629 bindings.CallRTCPeerConnectionSetIdentityProvider( 3630 this.ref, js.Pointer(&ret), 3631 provider.Ref(), 3632 js.Pointer(&options), 3633 ) 3634 3635 return 3636 } 3637 3638 // TrySetIdentityProvider calls the method "RTCPeerConnection.setIdentityProvider" 3639 // in a try/catch block and returns (_, err, ok = false) when it went through 3640 // the catch clause. 3641 func (this RTCPeerConnection) TrySetIdentityProvider(provider js.String, options RTCIdentityProviderOptions) (ret js.Void, exception js.Any, ok bool) { 3642 ok = js.True == bindings.TryRTCPeerConnectionSetIdentityProvider( 3643 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3644 provider.Ref(), 3645 js.Pointer(&options), 3646 ) 3647 3648 return 3649 } 3650 3651 // HasFuncSetIdentityProvider1 returns true if the method "RTCPeerConnection.setIdentityProvider" exists. 3652 func (this RTCPeerConnection) HasFuncSetIdentityProvider1() bool { 3653 return js.True == bindings.HasFuncRTCPeerConnectionSetIdentityProvider1( 3654 this.ref, 3655 ) 3656 } 3657 3658 // FuncSetIdentityProvider1 returns the method "RTCPeerConnection.setIdentityProvider". 3659 func (this RTCPeerConnection) FuncSetIdentityProvider1() (fn js.Func[func(provider js.String)]) { 3660 bindings.FuncRTCPeerConnectionSetIdentityProvider1( 3661 this.ref, js.Pointer(&fn), 3662 ) 3663 return 3664 } 3665 3666 // SetIdentityProvider1 calls the method "RTCPeerConnection.setIdentityProvider". 3667 func (this RTCPeerConnection) SetIdentityProvider1(provider js.String) (ret js.Void) { 3668 bindings.CallRTCPeerConnectionSetIdentityProvider1( 3669 this.ref, js.Pointer(&ret), 3670 provider.Ref(), 3671 ) 3672 3673 return 3674 } 3675 3676 // TrySetIdentityProvider1 calls the method "RTCPeerConnection.setIdentityProvider" 3677 // in a try/catch block and returns (_, err, ok = false) when it went through 3678 // the catch clause. 3679 func (this RTCPeerConnection) TrySetIdentityProvider1(provider js.String) (ret js.Void, exception js.Any, ok bool) { 3680 ok = js.True == bindings.TryRTCPeerConnectionSetIdentityProvider1( 3681 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3682 provider.Ref(), 3683 ) 3684 3685 return 3686 } 3687 3688 // HasFuncGetIdentityAssertion returns true if the method "RTCPeerConnection.getIdentityAssertion" exists. 3689 func (this RTCPeerConnection) HasFuncGetIdentityAssertion() bool { 3690 return js.True == bindings.HasFuncRTCPeerConnectionGetIdentityAssertion( 3691 this.ref, 3692 ) 3693 } 3694 3695 // FuncGetIdentityAssertion returns the method "RTCPeerConnection.getIdentityAssertion". 3696 func (this RTCPeerConnection) FuncGetIdentityAssertion() (fn js.Func[func() js.Promise[js.String]]) { 3697 bindings.FuncRTCPeerConnectionGetIdentityAssertion( 3698 this.ref, js.Pointer(&fn), 3699 ) 3700 return 3701 } 3702 3703 // GetIdentityAssertion calls the method "RTCPeerConnection.getIdentityAssertion". 3704 func (this RTCPeerConnection) GetIdentityAssertion() (ret js.Promise[js.String]) { 3705 bindings.CallRTCPeerConnectionGetIdentityAssertion( 3706 this.ref, js.Pointer(&ret), 3707 ) 3708 3709 return 3710 } 3711 3712 // TryGetIdentityAssertion calls the method "RTCPeerConnection.getIdentityAssertion" 3713 // in a try/catch block and returns (_, err, ok = false) when it went through 3714 // the catch clause. 3715 func (this RTCPeerConnection) TryGetIdentityAssertion() (ret js.Promise[js.String], exception js.Any, ok bool) { 3716 ok = js.True == bindings.TryRTCPeerConnectionGetIdentityAssertion( 3717 this.ref, js.Pointer(&ret), js.Pointer(&exception), 3718 ) 3719 3720 return 3721 } 3722 3723 type RTCPeerConnectionIceErrorEventInit struct { 3724 // Address is "RTCPeerConnectionIceErrorEventInit.address" 3725 // 3726 // Optional 3727 Address js.String 3728 // Port is "RTCPeerConnectionIceErrorEventInit.port" 3729 // 3730 // Optional 3731 // 3732 // NOTE: FFI_USE_Port MUST be set to true to make this field effective. 3733 Port uint16 3734 // Url is "RTCPeerConnectionIceErrorEventInit.url" 3735 // 3736 // Optional 3737 Url js.String 3738 // ErrorCode is "RTCPeerConnectionIceErrorEventInit.errorCode" 3739 // 3740 // Required 3741 ErrorCode uint16 3742 // ErrorText is "RTCPeerConnectionIceErrorEventInit.errorText" 3743 // 3744 // Optional 3745 ErrorText js.String 3746 // Bubbles is "RTCPeerConnectionIceErrorEventInit.bubbles" 3747 // 3748 // Optional, defaults to false. 3749 // 3750 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 3751 Bubbles bool 3752 // Cancelable is "RTCPeerConnectionIceErrorEventInit.cancelable" 3753 // 3754 // Optional, defaults to false. 3755 // 3756 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 3757 Cancelable bool 3758 // Composed is "RTCPeerConnectionIceErrorEventInit.composed" 3759 // 3760 // Optional, defaults to false. 3761 // 3762 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 3763 Composed bool 3764 3765 FFI_USE_Port bool // for Port. 3766 FFI_USE_Bubbles bool // for Bubbles. 3767 FFI_USE_Cancelable bool // for Cancelable. 3768 FFI_USE_Composed bool // for Composed. 3769 3770 FFI_USE bool 3771 } 3772 3773 // FromRef calls UpdateFrom and returns a RTCPeerConnectionIceErrorEventInit with all fields set. 3774 func (p RTCPeerConnectionIceErrorEventInit) FromRef(ref js.Ref) RTCPeerConnectionIceErrorEventInit { 3775 p.UpdateFrom(ref) 3776 return p 3777 } 3778 3779 // New creates a new RTCPeerConnectionIceErrorEventInit in the application heap. 3780 func (p RTCPeerConnectionIceErrorEventInit) New() js.Ref { 3781 return bindings.RTCPeerConnectionIceErrorEventInitJSLoad( 3782 js.Pointer(&p), js.True, 0, 3783 ) 3784 } 3785 3786 // UpdateFrom copies value of all fields of the heap object to p. 3787 func (p *RTCPeerConnectionIceErrorEventInit) UpdateFrom(ref js.Ref) { 3788 bindings.RTCPeerConnectionIceErrorEventInitJSStore( 3789 js.Pointer(p), ref, 3790 ) 3791 } 3792 3793 // Update writes all fields of the p to the heap object referenced by ref. 3794 func (p *RTCPeerConnectionIceErrorEventInit) Update(ref js.Ref) { 3795 bindings.RTCPeerConnectionIceErrorEventInitJSLoad( 3796 js.Pointer(p), js.False, ref, 3797 ) 3798 } 3799 3800 // FreeMembers frees fields with heap reference, if recursive is true 3801 // free all heap references reachable from p. 3802 func (p *RTCPeerConnectionIceErrorEventInit) FreeMembers(recursive bool) { 3803 js.Free( 3804 p.Address.Ref(), 3805 p.Url.Ref(), 3806 p.ErrorText.Ref(), 3807 ) 3808 p.Address = p.Address.FromRef(js.Undefined) 3809 p.Url = p.Url.FromRef(js.Undefined) 3810 p.ErrorText = p.ErrorText.FromRef(js.Undefined) 3811 } 3812 3813 func NewRTCPeerConnectionIceErrorEvent(typ js.String, eventInitDict RTCPeerConnectionIceErrorEventInit) (ret RTCPeerConnectionIceErrorEvent) { 3814 ret.ref = bindings.NewRTCPeerConnectionIceErrorEventByRTCPeerConnectionIceErrorEvent( 3815 typ.Ref(), 3816 js.Pointer(&eventInitDict)) 3817 return 3818 } 3819 3820 type RTCPeerConnectionIceErrorEvent struct { 3821 Event 3822 } 3823 3824 func (this RTCPeerConnectionIceErrorEvent) Once() RTCPeerConnectionIceErrorEvent { 3825 this.ref.Once() 3826 return this 3827 } 3828 3829 func (this RTCPeerConnectionIceErrorEvent) Ref() js.Ref { 3830 return this.Event.Ref() 3831 } 3832 3833 func (this RTCPeerConnectionIceErrorEvent) FromRef(ref js.Ref) RTCPeerConnectionIceErrorEvent { 3834 this.Event = this.Event.FromRef(ref) 3835 return this 3836 } 3837 3838 func (this RTCPeerConnectionIceErrorEvent) Free() { 3839 this.ref.Free() 3840 } 3841 3842 // Address returns the value of property "RTCPeerConnectionIceErrorEvent.address". 3843 // 3844 // It returns ok=false if there is no such property. 3845 func (this RTCPeerConnectionIceErrorEvent) Address() (ret js.String, ok bool) { 3846 ok = js.True == bindings.GetRTCPeerConnectionIceErrorEventAddress( 3847 this.ref, js.Pointer(&ret), 3848 ) 3849 return 3850 } 3851 3852 // Port returns the value of property "RTCPeerConnectionIceErrorEvent.port". 3853 // 3854 // It returns ok=false if there is no such property. 3855 func (this RTCPeerConnectionIceErrorEvent) Port() (ret uint16, ok bool) { 3856 ok = js.True == bindings.GetRTCPeerConnectionIceErrorEventPort( 3857 this.ref, js.Pointer(&ret), 3858 ) 3859 return 3860 } 3861 3862 // Url returns the value of property "RTCPeerConnectionIceErrorEvent.url". 3863 // 3864 // It returns ok=false if there is no such property. 3865 func (this RTCPeerConnectionIceErrorEvent) Url() (ret js.String, ok bool) { 3866 ok = js.True == bindings.GetRTCPeerConnectionIceErrorEventUrl( 3867 this.ref, js.Pointer(&ret), 3868 ) 3869 return 3870 } 3871 3872 // ErrorCode returns the value of property "RTCPeerConnectionIceErrorEvent.errorCode". 3873 // 3874 // It returns ok=false if there is no such property. 3875 func (this RTCPeerConnectionIceErrorEvent) ErrorCode() (ret uint16, ok bool) { 3876 ok = js.True == bindings.GetRTCPeerConnectionIceErrorEventErrorCode( 3877 this.ref, js.Pointer(&ret), 3878 ) 3879 return 3880 } 3881 3882 // ErrorText returns the value of property "RTCPeerConnectionIceErrorEvent.errorText". 3883 // 3884 // It returns ok=false if there is no such property. 3885 func (this RTCPeerConnectionIceErrorEvent) ErrorText() (ret js.String, ok bool) { 3886 ok = js.True == bindings.GetRTCPeerConnectionIceErrorEventErrorText( 3887 this.ref, js.Pointer(&ret), 3888 ) 3889 return 3890 } 3891 3892 type RTCPeerConnectionIceEventInit struct { 3893 // Candidate is "RTCPeerConnectionIceEventInit.candidate" 3894 // 3895 // Optional 3896 Candidate RTCIceCandidate 3897 // Url is "RTCPeerConnectionIceEventInit.url" 3898 // 3899 // Optional 3900 Url js.String 3901 // Bubbles is "RTCPeerConnectionIceEventInit.bubbles" 3902 // 3903 // Optional, defaults to false. 3904 // 3905 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 3906 Bubbles bool 3907 // Cancelable is "RTCPeerConnectionIceEventInit.cancelable" 3908 // 3909 // Optional, defaults to false. 3910 // 3911 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 3912 Cancelable bool 3913 // Composed is "RTCPeerConnectionIceEventInit.composed" 3914 // 3915 // Optional, defaults to false. 3916 // 3917 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 3918 Composed bool 3919 3920 FFI_USE_Bubbles bool // for Bubbles. 3921 FFI_USE_Cancelable bool // for Cancelable. 3922 FFI_USE_Composed bool // for Composed. 3923 3924 FFI_USE bool 3925 } 3926 3927 // FromRef calls UpdateFrom and returns a RTCPeerConnectionIceEventInit with all fields set. 3928 func (p RTCPeerConnectionIceEventInit) FromRef(ref js.Ref) RTCPeerConnectionIceEventInit { 3929 p.UpdateFrom(ref) 3930 return p 3931 } 3932 3933 // New creates a new RTCPeerConnectionIceEventInit in the application heap. 3934 func (p RTCPeerConnectionIceEventInit) New() js.Ref { 3935 return bindings.RTCPeerConnectionIceEventInitJSLoad( 3936 js.Pointer(&p), js.True, 0, 3937 ) 3938 } 3939 3940 // UpdateFrom copies value of all fields of the heap object to p. 3941 func (p *RTCPeerConnectionIceEventInit) UpdateFrom(ref js.Ref) { 3942 bindings.RTCPeerConnectionIceEventInitJSStore( 3943 js.Pointer(p), ref, 3944 ) 3945 } 3946 3947 // Update writes all fields of the p to the heap object referenced by ref. 3948 func (p *RTCPeerConnectionIceEventInit) Update(ref js.Ref) { 3949 bindings.RTCPeerConnectionIceEventInitJSLoad( 3950 js.Pointer(p), js.False, ref, 3951 ) 3952 } 3953 3954 // FreeMembers frees fields with heap reference, if recursive is true 3955 // free all heap references reachable from p. 3956 func (p *RTCPeerConnectionIceEventInit) FreeMembers(recursive bool) { 3957 js.Free( 3958 p.Candidate.Ref(), 3959 p.Url.Ref(), 3960 ) 3961 p.Candidate = p.Candidate.FromRef(js.Undefined) 3962 p.Url = p.Url.FromRef(js.Undefined) 3963 } 3964 3965 func NewRTCPeerConnectionIceEvent(typ js.String, eventInitDict RTCPeerConnectionIceEventInit) (ret RTCPeerConnectionIceEvent) { 3966 ret.ref = bindings.NewRTCPeerConnectionIceEventByRTCPeerConnectionIceEvent( 3967 typ.Ref(), 3968 js.Pointer(&eventInitDict)) 3969 return 3970 } 3971 3972 func NewRTCPeerConnectionIceEventByRTCPeerConnectionIceEvent1(typ js.String) (ret RTCPeerConnectionIceEvent) { 3973 ret.ref = bindings.NewRTCPeerConnectionIceEventByRTCPeerConnectionIceEvent1( 3974 typ.Ref()) 3975 return 3976 } 3977 3978 type RTCPeerConnectionIceEvent struct { 3979 Event 3980 } 3981 3982 func (this RTCPeerConnectionIceEvent) Once() RTCPeerConnectionIceEvent { 3983 this.ref.Once() 3984 return this 3985 } 3986 3987 func (this RTCPeerConnectionIceEvent) Ref() js.Ref { 3988 return this.Event.Ref() 3989 } 3990 3991 func (this RTCPeerConnectionIceEvent) FromRef(ref js.Ref) RTCPeerConnectionIceEvent { 3992 this.Event = this.Event.FromRef(ref) 3993 return this 3994 } 3995 3996 func (this RTCPeerConnectionIceEvent) Free() { 3997 this.ref.Free() 3998 } 3999 4000 // Candidate returns the value of property "RTCPeerConnectionIceEvent.candidate". 4001 // 4002 // It returns ok=false if there is no such property. 4003 func (this RTCPeerConnectionIceEvent) Candidate() (ret RTCIceCandidate, ok bool) { 4004 ok = js.True == bindings.GetRTCPeerConnectionIceEventCandidate( 4005 this.ref, js.Pointer(&ret), 4006 ) 4007 return 4008 } 4009 4010 // Url returns the value of property "RTCPeerConnectionIceEvent.url". 4011 // 4012 // It returns ok=false if there is no such property. 4013 func (this RTCPeerConnectionIceEvent) Url() (ret js.String, ok bool) { 4014 ok = js.True == bindings.GetRTCPeerConnectionIceEventUrl( 4015 this.ref, js.Pointer(&ret), 4016 ) 4017 return 4018 } 4019 4020 type RTCPeerConnectionStats struct { 4021 // DataChannelsOpened is "RTCPeerConnectionStats.dataChannelsOpened" 4022 // 4023 // Optional 4024 // 4025 // NOTE: FFI_USE_DataChannelsOpened MUST be set to true to make this field effective. 4026 DataChannelsOpened uint32 4027 // DataChannelsClosed is "RTCPeerConnectionStats.dataChannelsClosed" 4028 // 4029 // Optional 4030 // 4031 // NOTE: FFI_USE_DataChannelsClosed MUST be set to true to make this field effective. 4032 DataChannelsClosed uint32 4033 // Timestamp is "RTCPeerConnectionStats.timestamp" 4034 // 4035 // Required 4036 Timestamp DOMHighResTimeStamp 4037 // Type is "RTCPeerConnectionStats.type" 4038 // 4039 // Required 4040 Type RTCStatsType 4041 // Id is "RTCPeerConnectionStats.id" 4042 // 4043 // Required 4044 Id js.String 4045 4046 FFI_USE_DataChannelsOpened bool // for DataChannelsOpened. 4047 FFI_USE_DataChannelsClosed bool // for DataChannelsClosed. 4048 4049 FFI_USE bool 4050 } 4051 4052 // FromRef calls UpdateFrom and returns a RTCPeerConnectionStats with all fields set. 4053 func (p RTCPeerConnectionStats) FromRef(ref js.Ref) RTCPeerConnectionStats { 4054 p.UpdateFrom(ref) 4055 return p 4056 } 4057 4058 // New creates a new RTCPeerConnectionStats in the application heap. 4059 func (p RTCPeerConnectionStats) New() js.Ref { 4060 return bindings.RTCPeerConnectionStatsJSLoad( 4061 js.Pointer(&p), js.True, 0, 4062 ) 4063 } 4064 4065 // UpdateFrom copies value of all fields of the heap object to p. 4066 func (p *RTCPeerConnectionStats) UpdateFrom(ref js.Ref) { 4067 bindings.RTCPeerConnectionStatsJSStore( 4068 js.Pointer(p), ref, 4069 ) 4070 } 4071 4072 // Update writes all fields of the p to the heap object referenced by ref. 4073 func (p *RTCPeerConnectionStats) Update(ref js.Ref) { 4074 bindings.RTCPeerConnectionStatsJSLoad( 4075 js.Pointer(p), js.False, ref, 4076 ) 4077 } 4078 4079 // FreeMembers frees fields with heap reference, if recursive is true 4080 // free all heap references reachable from p. 4081 func (p *RTCPeerConnectionStats) FreeMembers(recursive bool) { 4082 js.Free( 4083 p.Id.Ref(), 4084 ) 4085 p.Id = p.Id.FromRef(js.Undefined) 4086 } 4087 4088 type RTCReceivedRtpStreamStats struct { 4089 // PacketsReceived is "RTCReceivedRtpStreamStats.packetsReceived" 4090 // 4091 // Optional 4092 // 4093 // NOTE: FFI_USE_PacketsReceived MUST be set to true to make this field effective. 4094 PacketsReceived uint64 4095 // PacketsLost is "RTCReceivedRtpStreamStats.packetsLost" 4096 // 4097 // Optional 4098 // 4099 // NOTE: FFI_USE_PacketsLost MUST be set to true to make this field effective. 4100 PacketsLost int64 4101 // Jitter is "RTCReceivedRtpStreamStats.jitter" 4102 // 4103 // Optional 4104 // 4105 // NOTE: FFI_USE_Jitter MUST be set to true to make this field effective. 4106 Jitter float64 4107 // Ssrc is "RTCReceivedRtpStreamStats.ssrc" 4108 // 4109 // Required 4110 Ssrc uint32 4111 // Kind is "RTCReceivedRtpStreamStats.kind" 4112 // 4113 // Required 4114 Kind js.String 4115 // TransportId is "RTCReceivedRtpStreamStats.transportId" 4116 // 4117 // Optional 4118 TransportId js.String 4119 // CodecId is "RTCReceivedRtpStreamStats.codecId" 4120 // 4121 // Optional 4122 CodecId js.String 4123 // Timestamp is "RTCReceivedRtpStreamStats.timestamp" 4124 // 4125 // Required 4126 Timestamp DOMHighResTimeStamp 4127 // Type is "RTCReceivedRtpStreamStats.type" 4128 // 4129 // Required 4130 Type RTCStatsType 4131 // Id is "RTCReceivedRtpStreamStats.id" 4132 // 4133 // Required 4134 Id js.String 4135 4136 FFI_USE_PacketsReceived bool // for PacketsReceived. 4137 FFI_USE_PacketsLost bool // for PacketsLost. 4138 FFI_USE_Jitter bool // for Jitter. 4139 4140 FFI_USE bool 4141 } 4142 4143 // FromRef calls UpdateFrom and returns a RTCReceivedRtpStreamStats with all fields set. 4144 func (p RTCReceivedRtpStreamStats) FromRef(ref js.Ref) RTCReceivedRtpStreamStats { 4145 p.UpdateFrom(ref) 4146 return p 4147 } 4148 4149 // New creates a new RTCReceivedRtpStreamStats in the application heap. 4150 func (p RTCReceivedRtpStreamStats) New() js.Ref { 4151 return bindings.RTCReceivedRtpStreamStatsJSLoad( 4152 js.Pointer(&p), js.True, 0, 4153 ) 4154 } 4155 4156 // UpdateFrom copies value of all fields of the heap object to p. 4157 func (p *RTCReceivedRtpStreamStats) UpdateFrom(ref js.Ref) { 4158 bindings.RTCReceivedRtpStreamStatsJSStore( 4159 js.Pointer(p), ref, 4160 ) 4161 } 4162 4163 // Update writes all fields of the p to the heap object referenced by ref. 4164 func (p *RTCReceivedRtpStreamStats) Update(ref js.Ref) { 4165 bindings.RTCReceivedRtpStreamStatsJSLoad( 4166 js.Pointer(p), js.False, ref, 4167 ) 4168 } 4169 4170 // FreeMembers frees fields with heap reference, if recursive is true 4171 // free all heap references reachable from p. 4172 func (p *RTCReceivedRtpStreamStats) FreeMembers(recursive bool) { 4173 js.Free( 4174 p.Kind.Ref(), 4175 p.TransportId.Ref(), 4176 p.CodecId.Ref(), 4177 p.Id.Ref(), 4178 ) 4179 p.Kind = p.Kind.FromRef(js.Undefined) 4180 p.TransportId = p.TransportId.FromRef(js.Undefined) 4181 p.CodecId = p.CodecId.FromRef(js.Undefined) 4182 p.Id = p.Id.FromRef(js.Undefined) 4183 } 4184 4185 type RTCRemoteInboundRtpStreamStats struct { 4186 // LocalId is "RTCRemoteInboundRtpStreamStats.localId" 4187 // 4188 // Optional 4189 LocalId js.String 4190 // RoundTripTime is "RTCRemoteInboundRtpStreamStats.roundTripTime" 4191 // 4192 // Optional 4193 // 4194 // NOTE: FFI_USE_RoundTripTime MUST be set to true to make this field effective. 4195 RoundTripTime float64 4196 // TotalRoundTripTime is "RTCRemoteInboundRtpStreamStats.totalRoundTripTime" 4197 // 4198 // Optional 4199 // 4200 // NOTE: FFI_USE_TotalRoundTripTime MUST be set to true to make this field effective. 4201 TotalRoundTripTime float64 4202 // FractionLost is "RTCRemoteInboundRtpStreamStats.fractionLost" 4203 // 4204 // Optional 4205 // 4206 // NOTE: FFI_USE_FractionLost MUST be set to true to make this field effective. 4207 FractionLost float64 4208 // RoundTripTimeMeasurements is "RTCRemoteInboundRtpStreamStats.roundTripTimeMeasurements" 4209 // 4210 // Optional 4211 // 4212 // NOTE: FFI_USE_RoundTripTimeMeasurements MUST be set to true to make this field effective. 4213 RoundTripTimeMeasurements uint64 4214 // PacketsReceived is "RTCRemoteInboundRtpStreamStats.packetsReceived" 4215 // 4216 // Optional 4217 // 4218 // NOTE: FFI_USE_PacketsReceived MUST be set to true to make this field effective. 4219 PacketsReceived uint64 4220 // PacketsLost is "RTCRemoteInboundRtpStreamStats.packetsLost" 4221 // 4222 // Optional 4223 // 4224 // NOTE: FFI_USE_PacketsLost MUST be set to true to make this field effective. 4225 PacketsLost int64 4226 // Jitter is "RTCRemoteInboundRtpStreamStats.jitter" 4227 // 4228 // Optional 4229 // 4230 // NOTE: FFI_USE_Jitter MUST be set to true to make this field effective. 4231 Jitter float64 4232 // Ssrc is "RTCRemoteInboundRtpStreamStats.ssrc" 4233 // 4234 // Required 4235 Ssrc uint32 4236 // Kind is "RTCRemoteInboundRtpStreamStats.kind" 4237 // 4238 // Required 4239 Kind js.String 4240 // TransportId is "RTCRemoteInboundRtpStreamStats.transportId" 4241 // 4242 // Optional 4243 TransportId js.String 4244 // CodecId is "RTCRemoteInboundRtpStreamStats.codecId" 4245 // 4246 // Optional 4247 CodecId js.String 4248 // Timestamp is "RTCRemoteInboundRtpStreamStats.timestamp" 4249 // 4250 // Required 4251 Timestamp DOMHighResTimeStamp 4252 // Type is "RTCRemoteInboundRtpStreamStats.type" 4253 // 4254 // Required 4255 Type RTCStatsType 4256 // Id is "RTCRemoteInboundRtpStreamStats.id" 4257 // 4258 // Required 4259 Id js.String 4260 4261 FFI_USE_RoundTripTime bool // for RoundTripTime. 4262 FFI_USE_TotalRoundTripTime bool // for TotalRoundTripTime. 4263 FFI_USE_FractionLost bool // for FractionLost. 4264 FFI_USE_RoundTripTimeMeasurements bool // for RoundTripTimeMeasurements. 4265 FFI_USE_PacketsReceived bool // for PacketsReceived. 4266 FFI_USE_PacketsLost bool // for PacketsLost. 4267 FFI_USE_Jitter bool // for Jitter. 4268 4269 FFI_USE bool 4270 } 4271 4272 // FromRef calls UpdateFrom and returns a RTCRemoteInboundRtpStreamStats with all fields set. 4273 func (p RTCRemoteInboundRtpStreamStats) FromRef(ref js.Ref) RTCRemoteInboundRtpStreamStats { 4274 p.UpdateFrom(ref) 4275 return p 4276 } 4277 4278 // New creates a new RTCRemoteInboundRtpStreamStats in the application heap. 4279 func (p RTCRemoteInboundRtpStreamStats) New() js.Ref { 4280 return bindings.RTCRemoteInboundRtpStreamStatsJSLoad( 4281 js.Pointer(&p), js.True, 0, 4282 ) 4283 } 4284 4285 // UpdateFrom copies value of all fields of the heap object to p. 4286 func (p *RTCRemoteInboundRtpStreamStats) UpdateFrom(ref js.Ref) { 4287 bindings.RTCRemoteInboundRtpStreamStatsJSStore( 4288 js.Pointer(p), ref, 4289 ) 4290 } 4291 4292 // Update writes all fields of the p to the heap object referenced by ref. 4293 func (p *RTCRemoteInboundRtpStreamStats) Update(ref js.Ref) { 4294 bindings.RTCRemoteInboundRtpStreamStatsJSLoad( 4295 js.Pointer(p), js.False, ref, 4296 ) 4297 } 4298 4299 // FreeMembers frees fields with heap reference, if recursive is true 4300 // free all heap references reachable from p. 4301 func (p *RTCRemoteInboundRtpStreamStats) FreeMembers(recursive bool) { 4302 js.Free( 4303 p.LocalId.Ref(), 4304 p.Kind.Ref(), 4305 p.TransportId.Ref(), 4306 p.CodecId.Ref(), 4307 p.Id.Ref(), 4308 ) 4309 p.LocalId = p.LocalId.FromRef(js.Undefined) 4310 p.Kind = p.Kind.FromRef(js.Undefined) 4311 p.TransportId = p.TransportId.FromRef(js.Undefined) 4312 p.CodecId = p.CodecId.FromRef(js.Undefined) 4313 p.Id = p.Id.FromRef(js.Undefined) 4314 } 4315 4316 type RTCRemoteOutboundRtpStreamStats struct { 4317 // LocalId is "RTCRemoteOutboundRtpStreamStats.localId" 4318 // 4319 // Optional 4320 LocalId js.String 4321 // RemoteTimestamp is "RTCRemoteOutboundRtpStreamStats.remoteTimestamp" 4322 // 4323 // Optional 4324 // 4325 // NOTE: FFI_USE_RemoteTimestamp MUST be set to true to make this field effective. 4326 RemoteTimestamp DOMHighResTimeStamp 4327 // ReportsSent is "RTCRemoteOutboundRtpStreamStats.reportsSent" 4328 // 4329 // Optional 4330 // 4331 // NOTE: FFI_USE_ReportsSent MUST be set to true to make this field effective. 4332 ReportsSent uint64 4333 // RoundTripTime is "RTCRemoteOutboundRtpStreamStats.roundTripTime" 4334 // 4335 // Optional 4336 // 4337 // NOTE: FFI_USE_RoundTripTime MUST be set to true to make this field effective. 4338 RoundTripTime float64 4339 // TotalRoundTripTime is "RTCRemoteOutboundRtpStreamStats.totalRoundTripTime" 4340 // 4341 // Optional 4342 // 4343 // NOTE: FFI_USE_TotalRoundTripTime MUST be set to true to make this field effective. 4344 TotalRoundTripTime float64 4345 // RoundTripTimeMeasurements is "RTCRemoteOutboundRtpStreamStats.roundTripTimeMeasurements" 4346 // 4347 // Optional 4348 // 4349 // NOTE: FFI_USE_RoundTripTimeMeasurements MUST be set to true to make this field effective. 4350 RoundTripTimeMeasurements uint64 4351 // PacketsSent is "RTCRemoteOutboundRtpStreamStats.packetsSent" 4352 // 4353 // Optional 4354 // 4355 // NOTE: FFI_USE_PacketsSent MUST be set to true to make this field effective. 4356 PacketsSent uint64 4357 // BytesSent is "RTCRemoteOutboundRtpStreamStats.bytesSent" 4358 // 4359 // Optional 4360 // 4361 // NOTE: FFI_USE_BytesSent MUST be set to true to make this field effective. 4362 BytesSent uint64 4363 // Ssrc is "RTCRemoteOutboundRtpStreamStats.ssrc" 4364 // 4365 // Required 4366 Ssrc uint32 4367 // Kind is "RTCRemoteOutboundRtpStreamStats.kind" 4368 // 4369 // Required 4370 Kind js.String 4371 // TransportId is "RTCRemoteOutboundRtpStreamStats.transportId" 4372 // 4373 // Optional 4374 TransportId js.String 4375 // CodecId is "RTCRemoteOutboundRtpStreamStats.codecId" 4376 // 4377 // Optional 4378 CodecId js.String 4379 // Timestamp is "RTCRemoteOutboundRtpStreamStats.timestamp" 4380 // 4381 // Required 4382 Timestamp DOMHighResTimeStamp 4383 // Type is "RTCRemoteOutboundRtpStreamStats.type" 4384 // 4385 // Required 4386 Type RTCStatsType 4387 // Id is "RTCRemoteOutboundRtpStreamStats.id" 4388 // 4389 // Required 4390 Id js.String 4391 4392 FFI_USE_RemoteTimestamp bool // for RemoteTimestamp. 4393 FFI_USE_ReportsSent bool // for ReportsSent. 4394 FFI_USE_RoundTripTime bool // for RoundTripTime. 4395 FFI_USE_TotalRoundTripTime bool // for TotalRoundTripTime. 4396 FFI_USE_RoundTripTimeMeasurements bool // for RoundTripTimeMeasurements. 4397 FFI_USE_PacketsSent bool // for PacketsSent. 4398 FFI_USE_BytesSent bool // for BytesSent. 4399 4400 FFI_USE bool 4401 } 4402 4403 // FromRef calls UpdateFrom and returns a RTCRemoteOutboundRtpStreamStats with all fields set. 4404 func (p RTCRemoteOutboundRtpStreamStats) FromRef(ref js.Ref) RTCRemoteOutboundRtpStreamStats { 4405 p.UpdateFrom(ref) 4406 return p 4407 } 4408 4409 // New creates a new RTCRemoteOutboundRtpStreamStats in the application heap. 4410 func (p RTCRemoteOutboundRtpStreamStats) New() js.Ref { 4411 return bindings.RTCRemoteOutboundRtpStreamStatsJSLoad( 4412 js.Pointer(&p), js.True, 0, 4413 ) 4414 } 4415 4416 // UpdateFrom copies value of all fields of the heap object to p. 4417 func (p *RTCRemoteOutboundRtpStreamStats) UpdateFrom(ref js.Ref) { 4418 bindings.RTCRemoteOutboundRtpStreamStatsJSStore( 4419 js.Pointer(p), ref, 4420 ) 4421 } 4422 4423 // Update writes all fields of the p to the heap object referenced by ref. 4424 func (p *RTCRemoteOutboundRtpStreamStats) Update(ref js.Ref) { 4425 bindings.RTCRemoteOutboundRtpStreamStatsJSLoad( 4426 js.Pointer(p), js.False, ref, 4427 ) 4428 } 4429 4430 // FreeMembers frees fields with heap reference, if recursive is true 4431 // free all heap references reachable from p. 4432 func (p *RTCRemoteOutboundRtpStreamStats) FreeMembers(recursive bool) { 4433 js.Free( 4434 p.LocalId.Ref(), 4435 p.Kind.Ref(), 4436 p.TransportId.Ref(), 4437 p.CodecId.Ref(), 4438 p.Id.Ref(), 4439 ) 4440 p.LocalId = p.LocalId.FromRef(js.Undefined) 4441 p.Kind = p.Kind.FromRef(js.Undefined) 4442 p.TransportId = p.TransportId.FromRef(js.Undefined) 4443 p.CodecId = p.CodecId.FromRef(js.Undefined) 4444 p.Id = p.Id.FromRef(js.Undefined) 4445 } 4446 4447 type RTCRtpCodec struct { 4448 // MimeType is "RTCRtpCodec.mimeType" 4449 // 4450 // Required 4451 MimeType js.String 4452 // ClockRate is "RTCRtpCodec.clockRate" 4453 // 4454 // Required 4455 ClockRate uint32 4456 // Channels is "RTCRtpCodec.channels" 4457 // 4458 // Optional 4459 // 4460 // NOTE: FFI_USE_Channels MUST be set to true to make this field effective. 4461 Channels uint16 4462 // SdpFmtpLine is "RTCRtpCodec.sdpFmtpLine" 4463 // 4464 // Optional 4465 SdpFmtpLine js.String 4466 4467 FFI_USE_Channels bool // for Channels. 4468 4469 FFI_USE bool 4470 } 4471 4472 // FromRef calls UpdateFrom and returns a RTCRtpCodec with all fields set. 4473 func (p RTCRtpCodec) FromRef(ref js.Ref) RTCRtpCodec { 4474 p.UpdateFrom(ref) 4475 return p 4476 } 4477 4478 // New creates a new RTCRtpCodec in the application heap. 4479 func (p RTCRtpCodec) New() js.Ref { 4480 return bindings.RTCRtpCodecJSLoad( 4481 js.Pointer(&p), js.True, 0, 4482 ) 4483 } 4484 4485 // UpdateFrom copies value of all fields of the heap object to p. 4486 func (p *RTCRtpCodec) UpdateFrom(ref js.Ref) { 4487 bindings.RTCRtpCodecJSStore( 4488 js.Pointer(p), ref, 4489 ) 4490 } 4491 4492 // Update writes all fields of the p to the heap object referenced by ref. 4493 func (p *RTCRtpCodec) Update(ref js.Ref) { 4494 bindings.RTCRtpCodecJSLoad( 4495 js.Pointer(p), js.False, ref, 4496 ) 4497 } 4498 4499 // FreeMembers frees fields with heap reference, if recursive is true 4500 // free all heap references reachable from p. 4501 func (p *RTCRtpCodec) FreeMembers(recursive bool) { 4502 js.Free( 4503 p.MimeType.Ref(), 4504 p.SdpFmtpLine.Ref(), 4505 ) 4506 p.MimeType = p.MimeType.FromRef(js.Undefined) 4507 p.SdpFmtpLine = p.SdpFmtpLine.FromRef(js.Undefined) 4508 } 4509 4510 type RTCRtpCodingParameters struct { 4511 // Rid is "RTCRtpCodingParameters.rid" 4512 // 4513 // Optional 4514 Rid js.String 4515 4516 FFI_USE bool 4517 } 4518 4519 // FromRef calls UpdateFrom and returns a RTCRtpCodingParameters with all fields set. 4520 func (p RTCRtpCodingParameters) FromRef(ref js.Ref) RTCRtpCodingParameters { 4521 p.UpdateFrom(ref) 4522 return p 4523 } 4524 4525 // New creates a new RTCRtpCodingParameters in the application heap. 4526 func (p RTCRtpCodingParameters) New() js.Ref { 4527 return bindings.RTCRtpCodingParametersJSLoad( 4528 js.Pointer(&p), js.True, 0, 4529 ) 4530 } 4531 4532 // UpdateFrom copies value of all fields of the heap object to p. 4533 func (p *RTCRtpCodingParameters) UpdateFrom(ref js.Ref) { 4534 bindings.RTCRtpCodingParametersJSStore( 4535 js.Pointer(p), ref, 4536 ) 4537 } 4538 4539 // Update writes all fields of the p to the heap object referenced by ref. 4540 func (p *RTCRtpCodingParameters) Update(ref js.Ref) { 4541 bindings.RTCRtpCodingParametersJSLoad( 4542 js.Pointer(p), js.False, ref, 4543 ) 4544 } 4545 4546 // FreeMembers frees fields with heap reference, if recursive is true 4547 // free all heap references reachable from p. 4548 func (p *RTCRtpCodingParameters) FreeMembers(recursive bool) { 4549 js.Free( 4550 p.Rid.Ref(), 4551 ) 4552 p.Rid = p.Rid.FromRef(js.Undefined) 4553 } 4554 4555 type RTCRtpParameters struct { 4556 // HeaderExtensions is "RTCRtpParameters.headerExtensions" 4557 // 4558 // Required 4559 HeaderExtensions js.Array[RTCRtpHeaderExtensionParameters] 4560 // Rtcp is "RTCRtpParameters.rtcp" 4561 // 4562 // Required 4563 // 4564 // NOTE: Rtcp.FFI_USE MUST be set to true to get Rtcp used. 4565 Rtcp RTCRtcpParameters 4566 // Codecs is "RTCRtpParameters.codecs" 4567 // 4568 // Required 4569 Codecs js.Array[RTCRtpCodecParameters] 4570 4571 FFI_USE bool 4572 } 4573 4574 // FromRef calls UpdateFrom and returns a RTCRtpParameters with all fields set. 4575 func (p RTCRtpParameters) FromRef(ref js.Ref) RTCRtpParameters { 4576 p.UpdateFrom(ref) 4577 return p 4578 } 4579 4580 // New creates a new RTCRtpParameters in the application heap. 4581 func (p RTCRtpParameters) New() js.Ref { 4582 return bindings.RTCRtpParametersJSLoad( 4583 js.Pointer(&p), js.True, 0, 4584 ) 4585 } 4586 4587 // UpdateFrom copies value of all fields of the heap object to p. 4588 func (p *RTCRtpParameters) UpdateFrom(ref js.Ref) { 4589 bindings.RTCRtpParametersJSStore( 4590 js.Pointer(p), ref, 4591 ) 4592 } 4593 4594 // Update writes all fields of the p to the heap object referenced by ref. 4595 func (p *RTCRtpParameters) Update(ref js.Ref) { 4596 bindings.RTCRtpParametersJSLoad( 4597 js.Pointer(p), js.False, ref, 4598 ) 4599 } 4600 4601 // FreeMembers frees fields with heap reference, if recursive is true 4602 // free all heap references reachable from p. 4603 func (p *RTCRtpParameters) FreeMembers(recursive bool) { 4604 js.Free( 4605 p.HeaderExtensions.Ref(), 4606 p.Codecs.Ref(), 4607 ) 4608 p.HeaderExtensions = p.HeaderExtensions.FromRef(js.Undefined) 4609 p.Codecs = p.Codecs.FromRef(js.Undefined) 4610 if recursive { 4611 p.Rtcp.FreeMembers(true) 4612 } 4613 } 4614 4615 type RTCRtpScriptTransformer struct { 4616 ref js.Ref 4617 } 4618 4619 func (this RTCRtpScriptTransformer) Once() RTCRtpScriptTransformer { 4620 this.ref.Once() 4621 return this 4622 } 4623 4624 func (this RTCRtpScriptTransformer) Ref() js.Ref { 4625 return this.ref 4626 } 4627 4628 func (this RTCRtpScriptTransformer) FromRef(ref js.Ref) RTCRtpScriptTransformer { 4629 this.ref = ref 4630 return this 4631 } 4632 4633 func (this RTCRtpScriptTransformer) Free() { 4634 this.ref.Free() 4635 } 4636 4637 // Readable returns the value of property "RTCRtpScriptTransformer.readable". 4638 // 4639 // It returns ok=false if there is no such property. 4640 func (this RTCRtpScriptTransformer) Readable() (ret ReadableStream, ok bool) { 4641 ok = js.True == bindings.GetRTCRtpScriptTransformerReadable( 4642 this.ref, js.Pointer(&ret), 4643 ) 4644 return 4645 } 4646 4647 // Writable returns the value of property "RTCRtpScriptTransformer.writable". 4648 // 4649 // It returns ok=false if there is no such property. 4650 func (this RTCRtpScriptTransformer) Writable() (ret WritableStream, ok bool) { 4651 ok = js.True == bindings.GetRTCRtpScriptTransformerWritable( 4652 this.ref, js.Pointer(&ret), 4653 ) 4654 return 4655 } 4656 4657 // Options returns the value of property "RTCRtpScriptTransformer.options". 4658 // 4659 // It returns ok=false if there is no such property. 4660 func (this RTCRtpScriptTransformer) Options() (ret js.Any, ok bool) { 4661 ok = js.True == bindings.GetRTCRtpScriptTransformerOptions( 4662 this.ref, js.Pointer(&ret), 4663 ) 4664 return 4665 } 4666 4667 // HasFuncGenerateKeyFrame returns true if the method "RTCRtpScriptTransformer.generateKeyFrame" exists. 4668 func (this RTCRtpScriptTransformer) HasFuncGenerateKeyFrame() bool { 4669 return js.True == bindings.HasFuncRTCRtpScriptTransformerGenerateKeyFrame( 4670 this.ref, 4671 ) 4672 } 4673 4674 // FuncGenerateKeyFrame returns the method "RTCRtpScriptTransformer.generateKeyFrame". 4675 func (this RTCRtpScriptTransformer) FuncGenerateKeyFrame() (fn js.Func[func(rid js.String) js.Promise[js.BigInt[uint64]]]) { 4676 bindings.FuncRTCRtpScriptTransformerGenerateKeyFrame( 4677 this.ref, js.Pointer(&fn), 4678 ) 4679 return 4680 } 4681 4682 // GenerateKeyFrame calls the method "RTCRtpScriptTransformer.generateKeyFrame". 4683 func (this RTCRtpScriptTransformer) GenerateKeyFrame(rid js.String) (ret js.Promise[js.BigInt[uint64]]) { 4684 bindings.CallRTCRtpScriptTransformerGenerateKeyFrame( 4685 this.ref, js.Pointer(&ret), 4686 rid.Ref(), 4687 ) 4688 4689 return 4690 } 4691 4692 // TryGenerateKeyFrame calls the method "RTCRtpScriptTransformer.generateKeyFrame" 4693 // in a try/catch block and returns (_, err, ok = false) when it went through 4694 // the catch clause. 4695 func (this RTCRtpScriptTransformer) TryGenerateKeyFrame(rid js.String) (ret js.Promise[js.BigInt[uint64]], exception js.Any, ok bool) { 4696 ok = js.True == bindings.TryRTCRtpScriptTransformerGenerateKeyFrame( 4697 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4698 rid.Ref(), 4699 ) 4700 4701 return 4702 } 4703 4704 // HasFuncGenerateKeyFrame1 returns true if the method "RTCRtpScriptTransformer.generateKeyFrame" exists. 4705 func (this RTCRtpScriptTransformer) HasFuncGenerateKeyFrame1() bool { 4706 return js.True == bindings.HasFuncRTCRtpScriptTransformerGenerateKeyFrame1( 4707 this.ref, 4708 ) 4709 } 4710 4711 // FuncGenerateKeyFrame1 returns the method "RTCRtpScriptTransformer.generateKeyFrame". 4712 func (this RTCRtpScriptTransformer) FuncGenerateKeyFrame1() (fn js.Func[func() js.Promise[js.BigInt[uint64]]]) { 4713 bindings.FuncRTCRtpScriptTransformerGenerateKeyFrame1( 4714 this.ref, js.Pointer(&fn), 4715 ) 4716 return 4717 } 4718 4719 // GenerateKeyFrame1 calls the method "RTCRtpScriptTransformer.generateKeyFrame". 4720 func (this RTCRtpScriptTransformer) GenerateKeyFrame1() (ret js.Promise[js.BigInt[uint64]]) { 4721 bindings.CallRTCRtpScriptTransformerGenerateKeyFrame1( 4722 this.ref, js.Pointer(&ret), 4723 ) 4724 4725 return 4726 } 4727 4728 // TryGenerateKeyFrame1 calls the method "RTCRtpScriptTransformer.generateKeyFrame" 4729 // in a try/catch block and returns (_, err, ok = false) when it went through 4730 // the catch clause. 4731 func (this RTCRtpScriptTransformer) TryGenerateKeyFrame1() (ret js.Promise[js.BigInt[uint64]], exception js.Any, ok bool) { 4732 ok = js.True == bindings.TryRTCRtpScriptTransformerGenerateKeyFrame1( 4733 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4734 ) 4735 4736 return 4737 } 4738 4739 // HasFuncSendKeyFrameRequest returns true if the method "RTCRtpScriptTransformer.sendKeyFrameRequest" exists. 4740 func (this RTCRtpScriptTransformer) HasFuncSendKeyFrameRequest() bool { 4741 return js.True == bindings.HasFuncRTCRtpScriptTransformerSendKeyFrameRequest( 4742 this.ref, 4743 ) 4744 } 4745 4746 // FuncSendKeyFrameRequest returns the method "RTCRtpScriptTransformer.sendKeyFrameRequest". 4747 func (this RTCRtpScriptTransformer) FuncSendKeyFrameRequest() (fn js.Func[func() js.Promise[js.Void]]) { 4748 bindings.FuncRTCRtpScriptTransformerSendKeyFrameRequest( 4749 this.ref, js.Pointer(&fn), 4750 ) 4751 return 4752 } 4753 4754 // SendKeyFrameRequest calls the method "RTCRtpScriptTransformer.sendKeyFrameRequest". 4755 func (this RTCRtpScriptTransformer) SendKeyFrameRequest() (ret js.Promise[js.Void]) { 4756 bindings.CallRTCRtpScriptTransformerSendKeyFrameRequest( 4757 this.ref, js.Pointer(&ret), 4758 ) 4759 4760 return 4761 } 4762 4763 // TrySendKeyFrameRequest calls the method "RTCRtpScriptTransformer.sendKeyFrameRequest" 4764 // in a try/catch block and returns (_, err, ok = false) when it went through 4765 // the catch clause. 4766 func (this RTCRtpScriptTransformer) TrySendKeyFrameRequest() (ret js.Promise[js.Void], exception js.Any, ok bool) { 4767 ok = js.True == bindings.TryRTCRtpScriptTransformerSendKeyFrameRequest( 4768 this.ref, js.Pointer(&ret), js.Pointer(&exception), 4769 ) 4770 4771 return 4772 } 4773 4774 type RTCRtpStreamStats struct { 4775 // Ssrc is "RTCRtpStreamStats.ssrc" 4776 // 4777 // Required 4778 Ssrc uint32 4779 // Kind is "RTCRtpStreamStats.kind" 4780 // 4781 // Required 4782 Kind js.String 4783 // TransportId is "RTCRtpStreamStats.transportId" 4784 // 4785 // Optional 4786 TransportId js.String 4787 // CodecId is "RTCRtpStreamStats.codecId" 4788 // 4789 // Optional 4790 CodecId js.String 4791 // Timestamp is "RTCRtpStreamStats.timestamp" 4792 // 4793 // Required 4794 Timestamp DOMHighResTimeStamp 4795 // Type is "RTCRtpStreamStats.type" 4796 // 4797 // Required 4798 Type RTCStatsType 4799 // Id is "RTCRtpStreamStats.id" 4800 // 4801 // Required 4802 Id js.String 4803 4804 FFI_USE bool 4805 } 4806 4807 // FromRef calls UpdateFrom and returns a RTCRtpStreamStats with all fields set. 4808 func (p RTCRtpStreamStats) FromRef(ref js.Ref) RTCRtpStreamStats { 4809 p.UpdateFrom(ref) 4810 return p 4811 } 4812 4813 // New creates a new RTCRtpStreamStats in the application heap. 4814 func (p RTCRtpStreamStats) New() js.Ref { 4815 return bindings.RTCRtpStreamStatsJSLoad( 4816 js.Pointer(&p), js.True, 0, 4817 ) 4818 } 4819 4820 // UpdateFrom copies value of all fields of the heap object to p. 4821 func (p *RTCRtpStreamStats) UpdateFrom(ref js.Ref) { 4822 bindings.RTCRtpStreamStatsJSStore( 4823 js.Pointer(p), ref, 4824 ) 4825 } 4826 4827 // Update writes all fields of the p to the heap object referenced by ref. 4828 func (p *RTCRtpStreamStats) Update(ref js.Ref) { 4829 bindings.RTCRtpStreamStatsJSLoad( 4830 js.Pointer(p), js.False, ref, 4831 ) 4832 } 4833 4834 // FreeMembers frees fields with heap reference, if recursive is true 4835 // free all heap references reachable from p. 4836 func (p *RTCRtpStreamStats) FreeMembers(recursive bool) { 4837 js.Free( 4838 p.Kind.Ref(), 4839 p.TransportId.Ref(), 4840 p.CodecId.Ref(), 4841 p.Id.Ref(), 4842 ) 4843 p.Kind = p.Kind.FromRef(js.Undefined) 4844 p.TransportId = p.TransportId.FromRef(js.Undefined) 4845 p.CodecId = p.CodecId.FromRef(js.Undefined) 4846 p.Id = p.Id.FromRef(js.Undefined) 4847 } 4848 4849 type RTCSentRtpStreamStats struct { 4850 // PacketsSent is "RTCSentRtpStreamStats.packetsSent" 4851 // 4852 // Optional 4853 // 4854 // NOTE: FFI_USE_PacketsSent MUST be set to true to make this field effective. 4855 PacketsSent uint64 4856 // BytesSent is "RTCSentRtpStreamStats.bytesSent" 4857 // 4858 // Optional 4859 // 4860 // NOTE: FFI_USE_BytesSent MUST be set to true to make this field effective. 4861 BytesSent uint64 4862 // Ssrc is "RTCSentRtpStreamStats.ssrc" 4863 // 4864 // Required 4865 Ssrc uint32 4866 // Kind is "RTCSentRtpStreamStats.kind" 4867 // 4868 // Required 4869 Kind js.String 4870 // TransportId is "RTCSentRtpStreamStats.transportId" 4871 // 4872 // Optional 4873 TransportId js.String 4874 // CodecId is "RTCSentRtpStreamStats.codecId" 4875 // 4876 // Optional 4877 CodecId js.String 4878 // Timestamp is "RTCSentRtpStreamStats.timestamp" 4879 // 4880 // Required 4881 Timestamp DOMHighResTimeStamp 4882 // Type is "RTCSentRtpStreamStats.type" 4883 // 4884 // Required 4885 Type RTCStatsType 4886 // Id is "RTCSentRtpStreamStats.id" 4887 // 4888 // Required 4889 Id js.String 4890 4891 FFI_USE_PacketsSent bool // for PacketsSent. 4892 FFI_USE_BytesSent bool // for BytesSent. 4893 4894 FFI_USE bool 4895 } 4896 4897 // FromRef calls UpdateFrom and returns a RTCSentRtpStreamStats with all fields set. 4898 func (p RTCSentRtpStreamStats) FromRef(ref js.Ref) RTCSentRtpStreamStats { 4899 p.UpdateFrom(ref) 4900 return p 4901 } 4902 4903 // New creates a new RTCSentRtpStreamStats in the application heap. 4904 func (p RTCSentRtpStreamStats) New() js.Ref { 4905 return bindings.RTCSentRtpStreamStatsJSLoad( 4906 js.Pointer(&p), js.True, 0, 4907 ) 4908 } 4909 4910 // UpdateFrom copies value of all fields of the heap object to p. 4911 func (p *RTCSentRtpStreamStats) UpdateFrom(ref js.Ref) { 4912 bindings.RTCSentRtpStreamStatsJSStore( 4913 js.Pointer(p), ref, 4914 ) 4915 } 4916 4917 // Update writes all fields of the p to the heap object referenced by ref. 4918 func (p *RTCSentRtpStreamStats) Update(ref js.Ref) { 4919 bindings.RTCSentRtpStreamStatsJSLoad( 4920 js.Pointer(p), js.False, ref, 4921 ) 4922 } 4923 4924 // FreeMembers frees fields with heap reference, if recursive is true 4925 // free all heap references reachable from p. 4926 func (p *RTCSentRtpStreamStats) FreeMembers(recursive bool) { 4927 js.Free( 4928 p.Kind.Ref(), 4929 p.TransportId.Ref(), 4930 p.CodecId.Ref(), 4931 p.Id.Ref(), 4932 ) 4933 p.Kind = p.Kind.FromRef(js.Undefined) 4934 p.TransportId = p.TransportId.FromRef(js.Undefined) 4935 p.CodecId = p.CodecId.FromRef(js.Undefined) 4936 p.Id = p.Id.FromRef(js.Undefined) 4937 } 4938 4939 type RTCStats struct { 4940 // Timestamp is "RTCStats.timestamp" 4941 // 4942 // Required 4943 Timestamp DOMHighResTimeStamp 4944 // Type is "RTCStats.type" 4945 // 4946 // Required 4947 Type RTCStatsType 4948 // Id is "RTCStats.id" 4949 // 4950 // Required 4951 Id js.String 4952 4953 FFI_USE bool 4954 } 4955 4956 // FromRef calls UpdateFrom and returns a RTCStats with all fields set. 4957 func (p RTCStats) FromRef(ref js.Ref) RTCStats { 4958 p.UpdateFrom(ref) 4959 return p 4960 } 4961 4962 // New creates a new RTCStats in the application heap. 4963 func (p RTCStats) New() js.Ref { 4964 return bindings.RTCStatsJSLoad( 4965 js.Pointer(&p), js.True, 0, 4966 ) 4967 } 4968 4969 // UpdateFrom copies value of all fields of the heap object to p. 4970 func (p *RTCStats) UpdateFrom(ref js.Ref) { 4971 bindings.RTCStatsJSStore( 4972 js.Pointer(p), ref, 4973 ) 4974 } 4975 4976 // Update writes all fields of the p to the heap object referenced by ref. 4977 func (p *RTCStats) Update(ref js.Ref) { 4978 bindings.RTCStatsJSLoad( 4979 js.Pointer(p), js.False, ref, 4980 ) 4981 } 4982 4983 // FreeMembers frees fields with heap reference, if recursive is true 4984 // free all heap references reachable from p. 4985 func (p *RTCStats) FreeMembers(recursive bool) { 4986 js.Free( 4987 p.Id.Ref(), 4988 ) 4989 p.Id = p.Id.FromRef(js.Undefined) 4990 }