github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis08_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 const ( 12 _ TextTrackMode = iota 13 14 TextTrackMode_DISABLED 15 TextTrackMode_HIDDEN 16 TextTrackMode_SHOWING 17 ) 18 19 func (TextTrackMode) FromRef(str js.Ref) TextTrackMode { 20 return TextTrackMode(bindings.ConstOfTextTrackMode(str)) 21 } 22 23 func (x TextTrackMode) String() (string, bool) { 24 switch x { 25 case TextTrackMode_DISABLED: 26 return "disabled", true 27 case TextTrackMode_HIDDEN: 28 return "hidden", true 29 case TextTrackMode_SHOWING: 30 return "showing", true 31 default: 32 return "", false 33 } 34 } 35 36 type TextTrackCueList struct { 37 ref js.Ref 38 } 39 40 func (this TextTrackCueList) Once() TextTrackCueList { 41 this.ref.Once() 42 return this 43 } 44 45 func (this TextTrackCueList) Ref() js.Ref { 46 return this.ref 47 } 48 49 func (this TextTrackCueList) FromRef(ref js.Ref) TextTrackCueList { 50 this.ref = ref 51 return this 52 } 53 54 func (this TextTrackCueList) Free() { 55 this.ref.Free() 56 } 57 58 // Length returns the value of property "TextTrackCueList.length". 59 // 60 // It returns ok=false if there is no such property. 61 func (this TextTrackCueList) Length() (ret uint32, ok bool) { 62 ok = js.True == bindings.GetTextTrackCueListLength( 63 this.ref, js.Pointer(&ret), 64 ) 65 return 66 } 67 68 // HasFuncGet returns true if the method "TextTrackCueList." exists. 69 func (this TextTrackCueList) HasFuncGet() bool { 70 return js.True == bindings.HasFuncTextTrackCueListGet( 71 this.ref, 72 ) 73 } 74 75 // FuncGet returns the method "TextTrackCueList.". 76 func (this TextTrackCueList) FuncGet() (fn js.Func[func(index uint32) TextTrackCue]) { 77 bindings.FuncTextTrackCueListGet( 78 this.ref, js.Pointer(&fn), 79 ) 80 return 81 } 82 83 // Get calls the method "TextTrackCueList.". 84 func (this TextTrackCueList) Get(index uint32) (ret TextTrackCue) { 85 bindings.CallTextTrackCueListGet( 86 this.ref, js.Pointer(&ret), 87 uint32(index), 88 ) 89 90 return 91 } 92 93 // TryGet calls the method "TextTrackCueList." 94 // in a try/catch block and returns (_, err, ok = false) when it went through 95 // the catch clause. 96 func (this TextTrackCueList) TryGet(index uint32) (ret TextTrackCue, exception js.Any, ok bool) { 97 ok = js.True == bindings.TryTextTrackCueListGet( 98 this.ref, js.Pointer(&ret), js.Pointer(&exception), 99 uint32(index), 100 ) 101 102 return 103 } 104 105 // HasFuncGetCueById returns true if the method "TextTrackCueList.getCueById" exists. 106 func (this TextTrackCueList) HasFuncGetCueById() bool { 107 return js.True == bindings.HasFuncTextTrackCueListGetCueById( 108 this.ref, 109 ) 110 } 111 112 // FuncGetCueById returns the method "TextTrackCueList.getCueById". 113 func (this TextTrackCueList) FuncGetCueById() (fn js.Func[func(id js.String) TextTrackCue]) { 114 bindings.FuncTextTrackCueListGetCueById( 115 this.ref, js.Pointer(&fn), 116 ) 117 return 118 } 119 120 // GetCueById calls the method "TextTrackCueList.getCueById". 121 func (this TextTrackCueList) GetCueById(id js.String) (ret TextTrackCue) { 122 bindings.CallTextTrackCueListGetCueById( 123 this.ref, js.Pointer(&ret), 124 id.Ref(), 125 ) 126 127 return 128 } 129 130 // TryGetCueById calls the method "TextTrackCueList.getCueById" 131 // in a try/catch block and returns (_, err, ok = false) when it went through 132 // the catch clause. 133 func (this TextTrackCueList) TryGetCueById(id js.String) (ret TextTrackCue, exception js.Any, ok bool) { 134 ok = js.True == bindings.TryTextTrackCueListGetCueById( 135 this.ref, js.Pointer(&ret), js.Pointer(&exception), 136 id.Ref(), 137 ) 138 139 return 140 } 141 142 type TimeRanges struct { 143 ref js.Ref 144 } 145 146 func (this TimeRanges) Once() TimeRanges { 147 this.ref.Once() 148 return this 149 } 150 151 func (this TimeRanges) Ref() js.Ref { 152 return this.ref 153 } 154 155 func (this TimeRanges) FromRef(ref js.Ref) TimeRanges { 156 this.ref = ref 157 return this 158 } 159 160 func (this TimeRanges) Free() { 161 this.ref.Free() 162 } 163 164 // Length returns the value of property "TimeRanges.length". 165 // 166 // It returns ok=false if there is no such property. 167 func (this TimeRanges) Length() (ret uint32, ok bool) { 168 ok = js.True == bindings.GetTimeRangesLength( 169 this.ref, js.Pointer(&ret), 170 ) 171 return 172 } 173 174 // HasFuncStart returns true if the method "TimeRanges.start" exists. 175 func (this TimeRanges) HasFuncStart() bool { 176 return js.True == bindings.HasFuncTimeRangesStart( 177 this.ref, 178 ) 179 } 180 181 // FuncStart returns the method "TimeRanges.start". 182 func (this TimeRanges) FuncStart() (fn js.Func[func(index uint32) float64]) { 183 bindings.FuncTimeRangesStart( 184 this.ref, js.Pointer(&fn), 185 ) 186 return 187 } 188 189 // Start calls the method "TimeRanges.start". 190 func (this TimeRanges) Start(index uint32) (ret float64) { 191 bindings.CallTimeRangesStart( 192 this.ref, js.Pointer(&ret), 193 uint32(index), 194 ) 195 196 return 197 } 198 199 // TryStart calls the method "TimeRanges.start" 200 // in a try/catch block and returns (_, err, ok = false) when it went through 201 // the catch clause. 202 func (this TimeRanges) TryStart(index uint32) (ret float64, exception js.Any, ok bool) { 203 ok = js.True == bindings.TryTimeRangesStart( 204 this.ref, js.Pointer(&ret), js.Pointer(&exception), 205 uint32(index), 206 ) 207 208 return 209 } 210 211 // HasFuncEnd returns true if the method "TimeRanges.end" exists. 212 func (this TimeRanges) HasFuncEnd() bool { 213 return js.True == bindings.HasFuncTimeRangesEnd( 214 this.ref, 215 ) 216 } 217 218 // FuncEnd returns the method "TimeRanges.end". 219 func (this TimeRanges) FuncEnd() (fn js.Func[func(index uint32) float64]) { 220 bindings.FuncTimeRangesEnd( 221 this.ref, js.Pointer(&fn), 222 ) 223 return 224 } 225 226 // End calls the method "TimeRanges.end". 227 func (this TimeRanges) End(index uint32) (ret float64) { 228 bindings.CallTimeRangesEnd( 229 this.ref, js.Pointer(&ret), 230 uint32(index), 231 ) 232 233 return 234 } 235 236 // TryEnd calls the method "TimeRanges.end" 237 // in a try/catch block and returns (_, err, ok = false) when it went through 238 // the catch clause. 239 func (this TimeRanges) TryEnd(index uint32) (ret float64, exception js.Any, ok bool) { 240 ok = js.True == bindings.TryTimeRangesEnd( 241 this.ref, js.Pointer(&ret), js.Pointer(&exception), 242 uint32(index), 243 ) 244 245 return 246 } 247 248 type AudioTrack struct { 249 ref js.Ref 250 } 251 252 func (this AudioTrack) Once() AudioTrack { 253 this.ref.Once() 254 return this 255 } 256 257 func (this AudioTrack) Ref() js.Ref { 258 return this.ref 259 } 260 261 func (this AudioTrack) FromRef(ref js.Ref) AudioTrack { 262 this.ref = ref 263 return this 264 } 265 266 func (this AudioTrack) Free() { 267 this.ref.Free() 268 } 269 270 // Id returns the value of property "AudioTrack.id". 271 // 272 // It returns ok=false if there is no such property. 273 func (this AudioTrack) Id() (ret js.String, ok bool) { 274 ok = js.True == bindings.GetAudioTrackId( 275 this.ref, js.Pointer(&ret), 276 ) 277 return 278 } 279 280 // Kind returns the value of property "AudioTrack.kind". 281 // 282 // It returns ok=false if there is no such property. 283 func (this AudioTrack) Kind() (ret js.String, ok bool) { 284 ok = js.True == bindings.GetAudioTrackKind( 285 this.ref, js.Pointer(&ret), 286 ) 287 return 288 } 289 290 // Label returns the value of property "AudioTrack.label". 291 // 292 // It returns ok=false if there is no such property. 293 func (this AudioTrack) Label() (ret js.String, ok bool) { 294 ok = js.True == bindings.GetAudioTrackLabel( 295 this.ref, js.Pointer(&ret), 296 ) 297 return 298 } 299 300 // Language returns the value of property "AudioTrack.language". 301 // 302 // It returns ok=false if there is no such property. 303 func (this AudioTrack) Language() (ret js.String, ok bool) { 304 ok = js.True == bindings.GetAudioTrackLanguage( 305 this.ref, js.Pointer(&ret), 306 ) 307 return 308 } 309 310 // Enabled returns the value of property "AudioTrack.enabled". 311 // 312 // It returns ok=false if there is no such property. 313 func (this AudioTrack) Enabled() (ret bool, ok bool) { 314 ok = js.True == bindings.GetAudioTrackEnabled( 315 this.ref, js.Pointer(&ret), 316 ) 317 return 318 } 319 320 // SetEnabled sets the value of property "AudioTrack.enabled" to val. 321 // 322 // It returns false if the property cannot be set. 323 func (this AudioTrack) SetEnabled(val bool) bool { 324 return js.True == bindings.SetAudioTrackEnabled( 325 this.ref, 326 js.Bool(bool(val)), 327 ) 328 } 329 330 // SourceBuffer returns the value of property "AudioTrack.sourceBuffer". 331 // 332 // It returns ok=false if there is no such property. 333 func (this AudioTrack) SourceBuffer() (ret SourceBuffer, ok bool) { 334 ok = js.True == bindings.GetAudioTrackSourceBuffer( 335 this.ref, js.Pointer(&ret), 336 ) 337 return 338 } 339 340 type AudioTrackList struct { 341 EventTarget 342 } 343 344 func (this AudioTrackList) Once() AudioTrackList { 345 this.ref.Once() 346 return this 347 } 348 349 func (this AudioTrackList) Ref() js.Ref { 350 return this.EventTarget.Ref() 351 } 352 353 func (this AudioTrackList) FromRef(ref js.Ref) AudioTrackList { 354 this.EventTarget = this.EventTarget.FromRef(ref) 355 return this 356 } 357 358 func (this AudioTrackList) Free() { 359 this.ref.Free() 360 } 361 362 // Length returns the value of property "AudioTrackList.length". 363 // 364 // It returns ok=false if there is no such property. 365 func (this AudioTrackList) Length() (ret uint32, ok bool) { 366 ok = js.True == bindings.GetAudioTrackListLength( 367 this.ref, js.Pointer(&ret), 368 ) 369 return 370 } 371 372 // HasFuncGet returns true if the method "AudioTrackList." exists. 373 func (this AudioTrackList) HasFuncGet() bool { 374 return js.True == bindings.HasFuncAudioTrackListGet( 375 this.ref, 376 ) 377 } 378 379 // FuncGet returns the method "AudioTrackList.". 380 func (this AudioTrackList) FuncGet() (fn js.Func[func(index uint32) AudioTrack]) { 381 bindings.FuncAudioTrackListGet( 382 this.ref, js.Pointer(&fn), 383 ) 384 return 385 } 386 387 // Get calls the method "AudioTrackList.". 388 func (this AudioTrackList) Get(index uint32) (ret AudioTrack) { 389 bindings.CallAudioTrackListGet( 390 this.ref, js.Pointer(&ret), 391 uint32(index), 392 ) 393 394 return 395 } 396 397 // TryGet calls the method "AudioTrackList." 398 // in a try/catch block and returns (_, err, ok = false) when it went through 399 // the catch clause. 400 func (this AudioTrackList) TryGet(index uint32) (ret AudioTrack, exception js.Any, ok bool) { 401 ok = js.True == bindings.TryAudioTrackListGet( 402 this.ref, js.Pointer(&ret), js.Pointer(&exception), 403 uint32(index), 404 ) 405 406 return 407 } 408 409 // HasFuncGetTrackById returns true if the method "AudioTrackList.getTrackById" exists. 410 func (this AudioTrackList) HasFuncGetTrackById() bool { 411 return js.True == bindings.HasFuncAudioTrackListGetTrackById( 412 this.ref, 413 ) 414 } 415 416 // FuncGetTrackById returns the method "AudioTrackList.getTrackById". 417 func (this AudioTrackList) FuncGetTrackById() (fn js.Func[func(id js.String) AudioTrack]) { 418 bindings.FuncAudioTrackListGetTrackById( 419 this.ref, js.Pointer(&fn), 420 ) 421 return 422 } 423 424 // GetTrackById calls the method "AudioTrackList.getTrackById". 425 func (this AudioTrackList) GetTrackById(id js.String) (ret AudioTrack) { 426 bindings.CallAudioTrackListGetTrackById( 427 this.ref, js.Pointer(&ret), 428 id.Ref(), 429 ) 430 431 return 432 } 433 434 // TryGetTrackById calls the method "AudioTrackList.getTrackById" 435 // in a try/catch block and returns (_, err, ok = false) when it went through 436 // the catch clause. 437 func (this AudioTrackList) TryGetTrackById(id js.String) (ret AudioTrack, exception js.Any, ok bool) { 438 ok = js.True == bindings.TryAudioTrackListGetTrackById( 439 this.ref, js.Pointer(&ret), js.Pointer(&exception), 440 id.Ref(), 441 ) 442 443 return 444 } 445 446 type VideoTrack struct { 447 ref js.Ref 448 } 449 450 func (this VideoTrack) Once() VideoTrack { 451 this.ref.Once() 452 return this 453 } 454 455 func (this VideoTrack) Ref() js.Ref { 456 return this.ref 457 } 458 459 func (this VideoTrack) FromRef(ref js.Ref) VideoTrack { 460 this.ref = ref 461 return this 462 } 463 464 func (this VideoTrack) Free() { 465 this.ref.Free() 466 } 467 468 // Id returns the value of property "VideoTrack.id". 469 // 470 // It returns ok=false if there is no such property. 471 func (this VideoTrack) Id() (ret js.String, ok bool) { 472 ok = js.True == bindings.GetVideoTrackId( 473 this.ref, js.Pointer(&ret), 474 ) 475 return 476 } 477 478 // Kind returns the value of property "VideoTrack.kind". 479 // 480 // It returns ok=false if there is no such property. 481 func (this VideoTrack) Kind() (ret js.String, ok bool) { 482 ok = js.True == bindings.GetVideoTrackKind( 483 this.ref, js.Pointer(&ret), 484 ) 485 return 486 } 487 488 // Label returns the value of property "VideoTrack.label". 489 // 490 // It returns ok=false if there is no such property. 491 func (this VideoTrack) Label() (ret js.String, ok bool) { 492 ok = js.True == bindings.GetVideoTrackLabel( 493 this.ref, js.Pointer(&ret), 494 ) 495 return 496 } 497 498 // Language returns the value of property "VideoTrack.language". 499 // 500 // It returns ok=false if there is no such property. 501 func (this VideoTrack) Language() (ret js.String, ok bool) { 502 ok = js.True == bindings.GetVideoTrackLanguage( 503 this.ref, js.Pointer(&ret), 504 ) 505 return 506 } 507 508 // Selected returns the value of property "VideoTrack.selected". 509 // 510 // It returns ok=false if there is no such property. 511 func (this VideoTrack) Selected() (ret bool, ok bool) { 512 ok = js.True == bindings.GetVideoTrackSelected( 513 this.ref, js.Pointer(&ret), 514 ) 515 return 516 } 517 518 // SetSelected sets the value of property "VideoTrack.selected" to val. 519 // 520 // It returns false if the property cannot be set. 521 func (this VideoTrack) SetSelected(val bool) bool { 522 return js.True == bindings.SetVideoTrackSelected( 523 this.ref, 524 js.Bool(bool(val)), 525 ) 526 } 527 528 // SourceBuffer returns the value of property "VideoTrack.sourceBuffer". 529 // 530 // It returns ok=false if there is no such property. 531 func (this VideoTrack) SourceBuffer() (ret SourceBuffer, ok bool) { 532 ok = js.True == bindings.GetVideoTrackSourceBuffer( 533 this.ref, js.Pointer(&ret), 534 ) 535 return 536 } 537 538 type VideoTrackList struct { 539 EventTarget 540 } 541 542 func (this VideoTrackList) Once() VideoTrackList { 543 this.ref.Once() 544 return this 545 } 546 547 func (this VideoTrackList) Ref() js.Ref { 548 return this.EventTarget.Ref() 549 } 550 551 func (this VideoTrackList) FromRef(ref js.Ref) VideoTrackList { 552 this.EventTarget = this.EventTarget.FromRef(ref) 553 return this 554 } 555 556 func (this VideoTrackList) Free() { 557 this.ref.Free() 558 } 559 560 // Length returns the value of property "VideoTrackList.length". 561 // 562 // It returns ok=false if there is no such property. 563 func (this VideoTrackList) Length() (ret uint32, ok bool) { 564 ok = js.True == bindings.GetVideoTrackListLength( 565 this.ref, js.Pointer(&ret), 566 ) 567 return 568 } 569 570 // SelectedIndex returns the value of property "VideoTrackList.selectedIndex". 571 // 572 // It returns ok=false if there is no such property. 573 func (this VideoTrackList) SelectedIndex() (ret int32, ok bool) { 574 ok = js.True == bindings.GetVideoTrackListSelectedIndex( 575 this.ref, js.Pointer(&ret), 576 ) 577 return 578 } 579 580 // HasFuncGet returns true if the method "VideoTrackList." exists. 581 func (this VideoTrackList) HasFuncGet() bool { 582 return js.True == bindings.HasFuncVideoTrackListGet( 583 this.ref, 584 ) 585 } 586 587 // FuncGet returns the method "VideoTrackList.". 588 func (this VideoTrackList) FuncGet() (fn js.Func[func(index uint32) VideoTrack]) { 589 bindings.FuncVideoTrackListGet( 590 this.ref, js.Pointer(&fn), 591 ) 592 return 593 } 594 595 // Get calls the method "VideoTrackList.". 596 func (this VideoTrackList) Get(index uint32) (ret VideoTrack) { 597 bindings.CallVideoTrackListGet( 598 this.ref, js.Pointer(&ret), 599 uint32(index), 600 ) 601 602 return 603 } 604 605 // TryGet calls the method "VideoTrackList." 606 // in a try/catch block and returns (_, err, ok = false) when it went through 607 // the catch clause. 608 func (this VideoTrackList) TryGet(index uint32) (ret VideoTrack, exception js.Any, ok bool) { 609 ok = js.True == bindings.TryVideoTrackListGet( 610 this.ref, js.Pointer(&ret), js.Pointer(&exception), 611 uint32(index), 612 ) 613 614 return 615 } 616 617 // HasFuncGetTrackById returns true if the method "VideoTrackList.getTrackById" exists. 618 func (this VideoTrackList) HasFuncGetTrackById() bool { 619 return js.True == bindings.HasFuncVideoTrackListGetTrackById( 620 this.ref, 621 ) 622 } 623 624 // FuncGetTrackById returns the method "VideoTrackList.getTrackById". 625 func (this VideoTrackList) FuncGetTrackById() (fn js.Func[func(id js.String) VideoTrack]) { 626 bindings.FuncVideoTrackListGetTrackById( 627 this.ref, js.Pointer(&fn), 628 ) 629 return 630 } 631 632 // GetTrackById calls the method "VideoTrackList.getTrackById". 633 func (this VideoTrackList) GetTrackById(id js.String) (ret VideoTrack) { 634 bindings.CallVideoTrackListGetTrackById( 635 this.ref, js.Pointer(&ret), 636 id.Ref(), 637 ) 638 639 return 640 } 641 642 // TryGetTrackById calls the method "VideoTrackList.getTrackById" 643 // in a try/catch block and returns (_, err, ok = false) when it went through 644 // the catch clause. 645 func (this VideoTrackList) TryGetTrackById(id js.String) (ret VideoTrack, exception js.Any, ok bool) { 646 ok = js.True == bindings.TryVideoTrackListGetTrackById( 647 this.ref, js.Pointer(&ret), js.Pointer(&exception), 648 id.Ref(), 649 ) 650 651 return 652 } 653 654 type TextTrackList struct { 655 EventTarget 656 } 657 658 func (this TextTrackList) Once() TextTrackList { 659 this.ref.Once() 660 return this 661 } 662 663 func (this TextTrackList) Ref() js.Ref { 664 return this.EventTarget.Ref() 665 } 666 667 func (this TextTrackList) FromRef(ref js.Ref) TextTrackList { 668 this.EventTarget = this.EventTarget.FromRef(ref) 669 return this 670 } 671 672 func (this TextTrackList) Free() { 673 this.ref.Free() 674 } 675 676 // Length returns the value of property "TextTrackList.length". 677 // 678 // It returns ok=false if there is no such property. 679 func (this TextTrackList) Length() (ret uint32, ok bool) { 680 ok = js.True == bindings.GetTextTrackListLength( 681 this.ref, js.Pointer(&ret), 682 ) 683 return 684 } 685 686 // HasFuncGet returns true if the method "TextTrackList." exists. 687 func (this TextTrackList) HasFuncGet() bool { 688 return js.True == bindings.HasFuncTextTrackListGet( 689 this.ref, 690 ) 691 } 692 693 // FuncGet returns the method "TextTrackList.". 694 func (this TextTrackList) FuncGet() (fn js.Func[func(index uint32) TextTrack]) { 695 bindings.FuncTextTrackListGet( 696 this.ref, js.Pointer(&fn), 697 ) 698 return 699 } 700 701 // Get calls the method "TextTrackList.". 702 func (this TextTrackList) Get(index uint32) (ret TextTrack) { 703 bindings.CallTextTrackListGet( 704 this.ref, js.Pointer(&ret), 705 uint32(index), 706 ) 707 708 return 709 } 710 711 // TryGet calls the method "TextTrackList." 712 // in a try/catch block and returns (_, err, ok = false) when it went through 713 // the catch clause. 714 func (this TextTrackList) TryGet(index uint32) (ret TextTrack, exception js.Any, ok bool) { 715 ok = js.True == bindings.TryTextTrackListGet( 716 this.ref, js.Pointer(&ret), js.Pointer(&exception), 717 uint32(index), 718 ) 719 720 return 721 } 722 723 // HasFuncGetTrackById returns true if the method "TextTrackList.getTrackById" exists. 724 func (this TextTrackList) HasFuncGetTrackById() bool { 725 return js.True == bindings.HasFuncTextTrackListGetTrackById( 726 this.ref, 727 ) 728 } 729 730 // FuncGetTrackById returns the method "TextTrackList.getTrackById". 731 func (this TextTrackList) FuncGetTrackById() (fn js.Func[func(id js.String) TextTrack]) { 732 bindings.FuncTextTrackListGetTrackById( 733 this.ref, js.Pointer(&fn), 734 ) 735 return 736 } 737 738 // GetTrackById calls the method "TextTrackList.getTrackById". 739 func (this TextTrackList) GetTrackById(id js.String) (ret TextTrack) { 740 bindings.CallTextTrackListGetTrackById( 741 this.ref, js.Pointer(&ret), 742 id.Ref(), 743 ) 744 745 return 746 } 747 748 // TryGetTrackById calls the method "TextTrackList.getTrackById" 749 // in a try/catch block and returns (_, err, ok = false) when it went through 750 // the catch clause. 751 func (this TextTrackList) TryGetTrackById(id js.String) (ret TextTrack, exception js.Any, ok bool) { 752 ok = js.True == bindings.TryTextTrackListGetTrackById( 753 this.ref, js.Pointer(&ret), js.Pointer(&exception), 754 id.Ref(), 755 ) 756 757 return 758 } 759 760 type SourceBuffer struct { 761 EventTarget 762 } 763 764 func (this SourceBuffer) Once() SourceBuffer { 765 this.ref.Once() 766 return this 767 } 768 769 func (this SourceBuffer) Ref() js.Ref { 770 return this.EventTarget.Ref() 771 } 772 773 func (this SourceBuffer) FromRef(ref js.Ref) SourceBuffer { 774 this.EventTarget = this.EventTarget.FromRef(ref) 775 return this 776 } 777 778 func (this SourceBuffer) Free() { 779 this.ref.Free() 780 } 781 782 // Mode returns the value of property "SourceBuffer.mode". 783 // 784 // It returns ok=false if there is no such property. 785 func (this SourceBuffer) Mode() (ret AppendMode, ok bool) { 786 ok = js.True == bindings.GetSourceBufferMode( 787 this.ref, js.Pointer(&ret), 788 ) 789 return 790 } 791 792 // SetMode sets the value of property "SourceBuffer.mode" to val. 793 // 794 // It returns false if the property cannot be set. 795 func (this SourceBuffer) SetMode(val AppendMode) bool { 796 return js.True == bindings.SetSourceBufferMode( 797 this.ref, 798 uint32(val), 799 ) 800 } 801 802 // Updating returns the value of property "SourceBuffer.updating". 803 // 804 // It returns ok=false if there is no such property. 805 func (this SourceBuffer) Updating() (ret bool, ok bool) { 806 ok = js.True == bindings.GetSourceBufferUpdating( 807 this.ref, js.Pointer(&ret), 808 ) 809 return 810 } 811 812 // Buffered returns the value of property "SourceBuffer.buffered". 813 // 814 // It returns ok=false if there is no such property. 815 func (this SourceBuffer) Buffered() (ret TimeRanges, ok bool) { 816 ok = js.True == bindings.GetSourceBufferBuffered( 817 this.ref, js.Pointer(&ret), 818 ) 819 return 820 } 821 822 // TimestampOffset returns the value of property "SourceBuffer.timestampOffset". 823 // 824 // It returns ok=false if there is no such property. 825 func (this SourceBuffer) TimestampOffset() (ret float64, ok bool) { 826 ok = js.True == bindings.GetSourceBufferTimestampOffset( 827 this.ref, js.Pointer(&ret), 828 ) 829 return 830 } 831 832 // SetTimestampOffset sets the value of property "SourceBuffer.timestampOffset" to val. 833 // 834 // It returns false if the property cannot be set. 835 func (this SourceBuffer) SetTimestampOffset(val float64) bool { 836 return js.True == bindings.SetSourceBufferTimestampOffset( 837 this.ref, 838 float64(val), 839 ) 840 } 841 842 // AudioTracks returns the value of property "SourceBuffer.audioTracks". 843 // 844 // It returns ok=false if there is no such property. 845 func (this SourceBuffer) AudioTracks() (ret AudioTrackList, ok bool) { 846 ok = js.True == bindings.GetSourceBufferAudioTracks( 847 this.ref, js.Pointer(&ret), 848 ) 849 return 850 } 851 852 // VideoTracks returns the value of property "SourceBuffer.videoTracks". 853 // 854 // It returns ok=false if there is no such property. 855 func (this SourceBuffer) VideoTracks() (ret VideoTrackList, ok bool) { 856 ok = js.True == bindings.GetSourceBufferVideoTracks( 857 this.ref, js.Pointer(&ret), 858 ) 859 return 860 } 861 862 // TextTracks returns the value of property "SourceBuffer.textTracks". 863 // 864 // It returns ok=false if there is no such property. 865 func (this SourceBuffer) TextTracks() (ret TextTrackList, ok bool) { 866 ok = js.True == bindings.GetSourceBufferTextTracks( 867 this.ref, js.Pointer(&ret), 868 ) 869 return 870 } 871 872 // AppendWindowStart returns the value of property "SourceBuffer.appendWindowStart". 873 // 874 // It returns ok=false if there is no such property. 875 func (this SourceBuffer) AppendWindowStart() (ret float64, ok bool) { 876 ok = js.True == bindings.GetSourceBufferAppendWindowStart( 877 this.ref, js.Pointer(&ret), 878 ) 879 return 880 } 881 882 // SetAppendWindowStart sets the value of property "SourceBuffer.appendWindowStart" to val. 883 // 884 // It returns false if the property cannot be set. 885 func (this SourceBuffer) SetAppendWindowStart(val float64) bool { 886 return js.True == bindings.SetSourceBufferAppendWindowStart( 887 this.ref, 888 float64(val), 889 ) 890 } 891 892 // AppendWindowEnd returns the value of property "SourceBuffer.appendWindowEnd". 893 // 894 // It returns ok=false if there is no such property. 895 func (this SourceBuffer) AppendWindowEnd() (ret float64, ok bool) { 896 ok = js.True == bindings.GetSourceBufferAppendWindowEnd( 897 this.ref, js.Pointer(&ret), 898 ) 899 return 900 } 901 902 // SetAppendWindowEnd sets the value of property "SourceBuffer.appendWindowEnd" to val. 903 // 904 // It returns false if the property cannot be set. 905 func (this SourceBuffer) SetAppendWindowEnd(val float64) bool { 906 return js.True == bindings.SetSourceBufferAppendWindowEnd( 907 this.ref, 908 float64(val), 909 ) 910 } 911 912 // HasFuncAppendBuffer returns true if the method "SourceBuffer.appendBuffer" exists. 913 func (this SourceBuffer) HasFuncAppendBuffer() bool { 914 return js.True == bindings.HasFuncSourceBufferAppendBuffer( 915 this.ref, 916 ) 917 } 918 919 // FuncAppendBuffer returns the method "SourceBuffer.appendBuffer". 920 func (this SourceBuffer) FuncAppendBuffer() (fn js.Func[func(data BufferSource)]) { 921 bindings.FuncSourceBufferAppendBuffer( 922 this.ref, js.Pointer(&fn), 923 ) 924 return 925 } 926 927 // AppendBuffer calls the method "SourceBuffer.appendBuffer". 928 func (this SourceBuffer) AppendBuffer(data BufferSource) (ret js.Void) { 929 bindings.CallSourceBufferAppendBuffer( 930 this.ref, js.Pointer(&ret), 931 data.Ref(), 932 ) 933 934 return 935 } 936 937 // TryAppendBuffer calls the method "SourceBuffer.appendBuffer" 938 // in a try/catch block and returns (_, err, ok = false) when it went through 939 // the catch clause. 940 func (this SourceBuffer) TryAppendBuffer(data BufferSource) (ret js.Void, exception js.Any, ok bool) { 941 ok = js.True == bindings.TrySourceBufferAppendBuffer( 942 this.ref, js.Pointer(&ret), js.Pointer(&exception), 943 data.Ref(), 944 ) 945 946 return 947 } 948 949 // HasFuncAbort returns true if the method "SourceBuffer.abort" exists. 950 func (this SourceBuffer) HasFuncAbort() bool { 951 return js.True == bindings.HasFuncSourceBufferAbort( 952 this.ref, 953 ) 954 } 955 956 // FuncAbort returns the method "SourceBuffer.abort". 957 func (this SourceBuffer) FuncAbort() (fn js.Func[func()]) { 958 bindings.FuncSourceBufferAbort( 959 this.ref, js.Pointer(&fn), 960 ) 961 return 962 } 963 964 // Abort calls the method "SourceBuffer.abort". 965 func (this SourceBuffer) Abort() (ret js.Void) { 966 bindings.CallSourceBufferAbort( 967 this.ref, js.Pointer(&ret), 968 ) 969 970 return 971 } 972 973 // TryAbort calls the method "SourceBuffer.abort" 974 // in a try/catch block and returns (_, err, ok = false) when it went through 975 // the catch clause. 976 func (this SourceBuffer) TryAbort() (ret js.Void, exception js.Any, ok bool) { 977 ok = js.True == bindings.TrySourceBufferAbort( 978 this.ref, js.Pointer(&ret), js.Pointer(&exception), 979 ) 980 981 return 982 } 983 984 // HasFuncChangeType returns true if the method "SourceBuffer.changeType" exists. 985 func (this SourceBuffer) HasFuncChangeType() bool { 986 return js.True == bindings.HasFuncSourceBufferChangeType( 987 this.ref, 988 ) 989 } 990 991 // FuncChangeType returns the method "SourceBuffer.changeType". 992 func (this SourceBuffer) FuncChangeType() (fn js.Func[func(typ js.String)]) { 993 bindings.FuncSourceBufferChangeType( 994 this.ref, js.Pointer(&fn), 995 ) 996 return 997 } 998 999 // ChangeType calls the method "SourceBuffer.changeType". 1000 func (this SourceBuffer) ChangeType(typ js.String) (ret js.Void) { 1001 bindings.CallSourceBufferChangeType( 1002 this.ref, js.Pointer(&ret), 1003 typ.Ref(), 1004 ) 1005 1006 return 1007 } 1008 1009 // TryChangeType calls the method "SourceBuffer.changeType" 1010 // in a try/catch block and returns (_, err, ok = false) when it went through 1011 // the catch clause. 1012 func (this SourceBuffer) TryChangeType(typ js.String) (ret js.Void, exception js.Any, ok bool) { 1013 ok = js.True == bindings.TrySourceBufferChangeType( 1014 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1015 typ.Ref(), 1016 ) 1017 1018 return 1019 } 1020 1021 // HasFuncRemove returns true if the method "SourceBuffer.remove" exists. 1022 func (this SourceBuffer) HasFuncRemove() bool { 1023 return js.True == bindings.HasFuncSourceBufferRemove( 1024 this.ref, 1025 ) 1026 } 1027 1028 // FuncRemove returns the method "SourceBuffer.remove". 1029 func (this SourceBuffer) FuncRemove() (fn js.Func[func(start float64, end float64)]) { 1030 bindings.FuncSourceBufferRemove( 1031 this.ref, js.Pointer(&fn), 1032 ) 1033 return 1034 } 1035 1036 // Remove calls the method "SourceBuffer.remove". 1037 func (this SourceBuffer) Remove(start float64, end float64) (ret js.Void) { 1038 bindings.CallSourceBufferRemove( 1039 this.ref, js.Pointer(&ret), 1040 float64(start), 1041 float64(end), 1042 ) 1043 1044 return 1045 } 1046 1047 // TryRemove calls the method "SourceBuffer.remove" 1048 // in a try/catch block and returns (_, err, ok = false) when it went through 1049 // the catch clause. 1050 func (this SourceBuffer) TryRemove(start float64, end float64) (ret js.Void, exception js.Any, ok bool) { 1051 ok = js.True == bindings.TrySourceBufferRemove( 1052 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1053 float64(start), 1054 float64(end), 1055 ) 1056 1057 return 1058 } 1059 1060 type TextTrack struct { 1061 EventTarget 1062 } 1063 1064 func (this TextTrack) Once() TextTrack { 1065 this.ref.Once() 1066 return this 1067 } 1068 1069 func (this TextTrack) Ref() js.Ref { 1070 return this.EventTarget.Ref() 1071 } 1072 1073 func (this TextTrack) FromRef(ref js.Ref) TextTrack { 1074 this.EventTarget = this.EventTarget.FromRef(ref) 1075 return this 1076 } 1077 1078 func (this TextTrack) Free() { 1079 this.ref.Free() 1080 } 1081 1082 // Kind returns the value of property "TextTrack.kind". 1083 // 1084 // It returns ok=false if there is no such property. 1085 func (this TextTrack) Kind() (ret TextTrackKind, ok bool) { 1086 ok = js.True == bindings.GetTextTrackKind( 1087 this.ref, js.Pointer(&ret), 1088 ) 1089 return 1090 } 1091 1092 // Label returns the value of property "TextTrack.label". 1093 // 1094 // It returns ok=false if there is no such property. 1095 func (this TextTrack) Label() (ret js.String, ok bool) { 1096 ok = js.True == bindings.GetTextTrackLabel( 1097 this.ref, js.Pointer(&ret), 1098 ) 1099 return 1100 } 1101 1102 // Language returns the value of property "TextTrack.language". 1103 // 1104 // It returns ok=false if there is no such property. 1105 func (this TextTrack) Language() (ret js.String, ok bool) { 1106 ok = js.True == bindings.GetTextTrackLanguage( 1107 this.ref, js.Pointer(&ret), 1108 ) 1109 return 1110 } 1111 1112 // Id returns the value of property "TextTrack.id". 1113 // 1114 // It returns ok=false if there is no such property. 1115 func (this TextTrack) Id() (ret js.String, ok bool) { 1116 ok = js.True == bindings.GetTextTrackId( 1117 this.ref, js.Pointer(&ret), 1118 ) 1119 return 1120 } 1121 1122 // InBandMetadataTrackDispatchType returns the value of property "TextTrack.inBandMetadataTrackDispatchType". 1123 // 1124 // It returns ok=false if there is no such property. 1125 func (this TextTrack) InBandMetadataTrackDispatchType() (ret js.String, ok bool) { 1126 ok = js.True == bindings.GetTextTrackInBandMetadataTrackDispatchType( 1127 this.ref, js.Pointer(&ret), 1128 ) 1129 return 1130 } 1131 1132 // Mode returns the value of property "TextTrack.mode". 1133 // 1134 // It returns ok=false if there is no such property. 1135 func (this TextTrack) Mode() (ret TextTrackMode, ok bool) { 1136 ok = js.True == bindings.GetTextTrackMode( 1137 this.ref, js.Pointer(&ret), 1138 ) 1139 return 1140 } 1141 1142 // SetMode sets the value of property "TextTrack.mode" to val. 1143 // 1144 // It returns false if the property cannot be set. 1145 func (this TextTrack) SetMode(val TextTrackMode) bool { 1146 return js.True == bindings.SetTextTrackMode( 1147 this.ref, 1148 uint32(val), 1149 ) 1150 } 1151 1152 // Cues returns the value of property "TextTrack.cues". 1153 // 1154 // It returns ok=false if there is no such property. 1155 func (this TextTrack) Cues() (ret TextTrackCueList, ok bool) { 1156 ok = js.True == bindings.GetTextTrackCues( 1157 this.ref, js.Pointer(&ret), 1158 ) 1159 return 1160 } 1161 1162 // ActiveCues returns the value of property "TextTrack.activeCues". 1163 // 1164 // It returns ok=false if there is no such property. 1165 func (this TextTrack) ActiveCues() (ret TextTrackCueList, ok bool) { 1166 ok = js.True == bindings.GetTextTrackActiveCues( 1167 this.ref, js.Pointer(&ret), 1168 ) 1169 return 1170 } 1171 1172 // SourceBuffer returns the value of property "TextTrack.sourceBuffer". 1173 // 1174 // It returns ok=false if there is no such property. 1175 func (this TextTrack) SourceBuffer() (ret SourceBuffer, ok bool) { 1176 ok = js.True == bindings.GetTextTrackSourceBuffer( 1177 this.ref, js.Pointer(&ret), 1178 ) 1179 return 1180 } 1181 1182 // HasFuncAddCue returns true if the method "TextTrack.addCue" exists. 1183 func (this TextTrack) HasFuncAddCue() bool { 1184 return js.True == bindings.HasFuncTextTrackAddCue( 1185 this.ref, 1186 ) 1187 } 1188 1189 // FuncAddCue returns the method "TextTrack.addCue". 1190 func (this TextTrack) FuncAddCue() (fn js.Func[func(cue TextTrackCue)]) { 1191 bindings.FuncTextTrackAddCue( 1192 this.ref, js.Pointer(&fn), 1193 ) 1194 return 1195 } 1196 1197 // AddCue calls the method "TextTrack.addCue". 1198 func (this TextTrack) AddCue(cue TextTrackCue) (ret js.Void) { 1199 bindings.CallTextTrackAddCue( 1200 this.ref, js.Pointer(&ret), 1201 cue.Ref(), 1202 ) 1203 1204 return 1205 } 1206 1207 // TryAddCue calls the method "TextTrack.addCue" 1208 // in a try/catch block and returns (_, err, ok = false) when it went through 1209 // the catch clause. 1210 func (this TextTrack) TryAddCue(cue TextTrackCue) (ret js.Void, exception js.Any, ok bool) { 1211 ok = js.True == bindings.TryTextTrackAddCue( 1212 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1213 cue.Ref(), 1214 ) 1215 1216 return 1217 } 1218 1219 // HasFuncRemoveCue returns true if the method "TextTrack.removeCue" exists. 1220 func (this TextTrack) HasFuncRemoveCue() bool { 1221 return js.True == bindings.HasFuncTextTrackRemoveCue( 1222 this.ref, 1223 ) 1224 } 1225 1226 // FuncRemoveCue returns the method "TextTrack.removeCue". 1227 func (this TextTrack) FuncRemoveCue() (fn js.Func[func(cue TextTrackCue)]) { 1228 bindings.FuncTextTrackRemoveCue( 1229 this.ref, js.Pointer(&fn), 1230 ) 1231 return 1232 } 1233 1234 // RemoveCue calls the method "TextTrack.removeCue". 1235 func (this TextTrack) RemoveCue(cue TextTrackCue) (ret js.Void) { 1236 bindings.CallTextTrackRemoveCue( 1237 this.ref, js.Pointer(&ret), 1238 cue.Ref(), 1239 ) 1240 1241 return 1242 } 1243 1244 // TryRemoveCue calls the method "TextTrack.removeCue" 1245 // in a try/catch block and returns (_, err, ok = false) when it went through 1246 // the catch clause. 1247 func (this TextTrack) TryRemoveCue(cue TextTrackCue) (ret js.Void, exception js.Any, ok bool) { 1248 ok = js.True == bindings.TryTextTrackRemoveCue( 1249 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1250 cue.Ref(), 1251 ) 1252 1253 return 1254 } 1255 1256 type MediaKeySessionClosedReason uint32 1257 1258 const ( 1259 _ MediaKeySessionClosedReason = iota 1260 1261 MediaKeySessionClosedReason_INTERNAL_ERROR 1262 MediaKeySessionClosedReason_CLOSED_BY_APPLICATION 1263 MediaKeySessionClosedReason_RELEASE_ACKNOWLEDGED 1264 MediaKeySessionClosedReason_HARDWARE_CONTEXT_RESET 1265 MediaKeySessionClosedReason_RESOURCE_EVICTED 1266 ) 1267 1268 func (MediaKeySessionClosedReason) FromRef(str js.Ref) MediaKeySessionClosedReason { 1269 return MediaKeySessionClosedReason(bindings.ConstOfMediaKeySessionClosedReason(str)) 1270 } 1271 1272 func (x MediaKeySessionClosedReason) String() (string, bool) { 1273 switch x { 1274 case MediaKeySessionClosedReason_INTERNAL_ERROR: 1275 return "internal-error", true 1276 case MediaKeySessionClosedReason_CLOSED_BY_APPLICATION: 1277 return "closed-by-application", true 1278 case MediaKeySessionClosedReason_RELEASE_ACKNOWLEDGED: 1279 return "release-acknowledged", true 1280 case MediaKeySessionClosedReason_HARDWARE_CONTEXT_RESET: 1281 return "hardware-context-reset", true 1282 case MediaKeySessionClosedReason_RESOURCE_EVICTED: 1283 return "resource-evicted", true 1284 default: 1285 return "", false 1286 } 1287 } 1288 1289 type MediaKeyStatus uint32 1290 1291 const ( 1292 _ MediaKeyStatus = iota 1293 1294 MediaKeyStatus_USABLE 1295 MediaKeyStatus_EXPIRED 1296 MediaKeyStatus_RELEASED 1297 MediaKeyStatus_OUTPUT_RESTRICTED 1298 MediaKeyStatus_OUTPUT_DOWNSCALED 1299 MediaKeyStatus_USABLE_IN_FUTURE 1300 MediaKeyStatus_STATUS_PENDING 1301 MediaKeyStatus_INTERNAL_ERROR 1302 ) 1303 1304 func (MediaKeyStatus) FromRef(str js.Ref) MediaKeyStatus { 1305 return MediaKeyStatus(bindings.ConstOfMediaKeyStatus(str)) 1306 } 1307 1308 func (x MediaKeyStatus) String() (string, bool) { 1309 switch x { 1310 case MediaKeyStatus_USABLE: 1311 return "usable", true 1312 case MediaKeyStatus_EXPIRED: 1313 return "expired", true 1314 case MediaKeyStatus_RELEASED: 1315 return "released", true 1316 case MediaKeyStatus_OUTPUT_RESTRICTED: 1317 return "output-restricted", true 1318 case MediaKeyStatus_OUTPUT_DOWNSCALED: 1319 return "output-downscaled", true 1320 case MediaKeyStatus_USABLE_IN_FUTURE: 1321 return "usable-in-future", true 1322 case MediaKeyStatus_STATUS_PENDING: 1323 return "status-pending", true 1324 case MediaKeyStatus_INTERNAL_ERROR: 1325 return "internal-error", true 1326 default: 1327 return "", false 1328 } 1329 } 1330 1331 type OneOf_MediaKeyStatus_undefined struct { 1332 ref js.Ref 1333 } 1334 1335 func (x OneOf_MediaKeyStatus_undefined) Ref() js.Ref { 1336 return x.ref 1337 } 1338 1339 func (x OneOf_MediaKeyStatus_undefined) Free() { 1340 x.ref.Free() 1341 } 1342 1343 func (x OneOf_MediaKeyStatus_undefined) FromRef(ref js.Ref) OneOf_MediaKeyStatus_undefined { 1344 return OneOf_MediaKeyStatus_undefined{ 1345 ref: ref, 1346 } 1347 } 1348 1349 func (x OneOf_MediaKeyStatus_undefined) Undefined() bool { 1350 return x.ref == js.Undefined 1351 } 1352 1353 func (x OneOf_MediaKeyStatus_undefined) MediaKeyStatus() MediaKeyStatus { 1354 return MediaKeyStatus(0).FromRef(x.ref) 1355 } 1356 1357 type MediaKeyStatusMap struct { 1358 ref js.Ref 1359 } 1360 1361 func (this MediaKeyStatusMap) Once() MediaKeyStatusMap { 1362 this.ref.Once() 1363 return this 1364 } 1365 1366 func (this MediaKeyStatusMap) Ref() js.Ref { 1367 return this.ref 1368 } 1369 1370 func (this MediaKeyStatusMap) FromRef(ref js.Ref) MediaKeyStatusMap { 1371 this.ref = ref 1372 return this 1373 } 1374 1375 func (this MediaKeyStatusMap) Free() { 1376 this.ref.Free() 1377 } 1378 1379 // Size returns the value of property "MediaKeyStatusMap.size". 1380 // 1381 // It returns ok=false if there is no such property. 1382 func (this MediaKeyStatusMap) Size() (ret uint32, ok bool) { 1383 ok = js.True == bindings.GetMediaKeyStatusMapSize( 1384 this.ref, js.Pointer(&ret), 1385 ) 1386 return 1387 } 1388 1389 // HasFuncHas returns true if the method "MediaKeyStatusMap.has" exists. 1390 func (this MediaKeyStatusMap) HasFuncHas() bool { 1391 return js.True == bindings.HasFuncMediaKeyStatusMapHas( 1392 this.ref, 1393 ) 1394 } 1395 1396 // FuncHas returns the method "MediaKeyStatusMap.has". 1397 func (this MediaKeyStatusMap) FuncHas() (fn js.Func[func(keyId BufferSource) bool]) { 1398 bindings.FuncMediaKeyStatusMapHas( 1399 this.ref, js.Pointer(&fn), 1400 ) 1401 return 1402 } 1403 1404 // Has calls the method "MediaKeyStatusMap.has". 1405 func (this MediaKeyStatusMap) Has(keyId BufferSource) (ret bool) { 1406 bindings.CallMediaKeyStatusMapHas( 1407 this.ref, js.Pointer(&ret), 1408 keyId.Ref(), 1409 ) 1410 1411 return 1412 } 1413 1414 // TryHas calls the method "MediaKeyStatusMap.has" 1415 // in a try/catch block and returns (_, err, ok = false) when it went through 1416 // the catch clause. 1417 func (this MediaKeyStatusMap) TryHas(keyId BufferSource) (ret bool, exception js.Any, ok bool) { 1418 ok = js.True == bindings.TryMediaKeyStatusMapHas( 1419 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1420 keyId.Ref(), 1421 ) 1422 1423 return 1424 } 1425 1426 // HasFuncGet returns true if the method "MediaKeyStatusMap.get" exists. 1427 func (this MediaKeyStatusMap) HasFuncGet() bool { 1428 return js.True == bindings.HasFuncMediaKeyStatusMapGet( 1429 this.ref, 1430 ) 1431 } 1432 1433 // FuncGet returns the method "MediaKeyStatusMap.get". 1434 func (this MediaKeyStatusMap) FuncGet() (fn js.Func[func(keyId BufferSource) OneOf_MediaKeyStatus_undefined]) { 1435 bindings.FuncMediaKeyStatusMapGet( 1436 this.ref, js.Pointer(&fn), 1437 ) 1438 return 1439 } 1440 1441 // Get calls the method "MediaKeyStatusMap.get". 1442 func (this MediaKeyStatusMap) Get(keyId BufferSource) (ret OneOf_MediaKeyStatus_undefined) { 1443 bindings.CallMediaKeyStatusMapGet( 1444 this.ref, js.Pointer(&ret), 1445 keyId.Ref(), 1446 ) 1447 1448 return 1449 } 1450 1451 // TryGet calls the method "MediaKeyStatusMap.get" 1452 // in a try/catch block and returns (_, err, ok = false) when it went through 1453 // the catch clause. 1454 func (this MediaKeyStatusMap) TryGet(keyId BufferSource) (ret OneOf_MediaKeyStatus_undefined, exception js.Any, ok bool) { 1455 ok = js.True == bindings.TryMediaKeyStatusMapGet( 1456 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1457 keyId.Ref(), 1458 ) 1459 1460 return 1461 } 1462 1463 type MediaKeySession struct { 1464 EventTarget 1465 } 1466 1467 func (this MediaKeySession) Once() MediaKeySession { 1468 this.ref.Once() 1469 return this 1470 } 1471 1472 func (this MediaKeySession) Ref() js.Ref { 1473 return this.EventTarget.Ref() 1474 } 1475 1476 func (this MediaKeySession) FromRef(ref js.Ref) MediaKeySession { 1477 this.EventTarget = this.EventTarget.FromRef(ref) 1478 return this 1479 } 1480 1481 func (this MediaKeySession) Free() { 1482 this.ref.Free() 1483 } 1484 1485 // SessionId returns the value of property "MediaKeySession.sessionId". 1486 // 1487 // It returns ok=false if there is no such property. 1488 func (this MediaKeySession) SessionId() (ret js.String, ok bool) { 1489 ok = js.True == bindings.GetMediaKeySessionSessionId( 1490 this.ref, js.Pointer(&ret), 1491 ) 1492 return 1493 } 1494 1495 // Expiration returns the value of property "MediaKeySession.expiration". 1496 // 1497 // It returns ok=false if there is no such property. 1498 func (this MediaKeySession) Expiration() (ret float64, ok bool) { 1499 ok = js.True == bindings.GetMediaKeySessionExpiration( 1500 this.ref, js.Pointer(&ret), 1501 ) 1502 return 1503 } 1504 1505 // Closed returns the value of property "MediaKeySession.closed". 1506 // 1507 // It returns ok=false if there is no such property. 1508 func (this MediaKeySession) Closed() (ret js.Promise[MediaKeySessionClosedReason], ok bool) { 1509 ok = js.True == bindings.GetMediaKeySessionClosed( 1510 this.ref, js.Pointer(&ret), 1511 ) 1512 return 1513 } 1514 1515 // KeyStatuses returns the value of property "MediaKeySession.keyStatuses". 1516 // 1517 // It returns ok=false if there is no such property. 1518 func (this MediaKeySession) KeyStatuses() (ret MediaKeyStatusMap, ok bool) { 1519 ok = js.True == bindings.GetMediaKeySessionKeyStatuses( 1520 this.ref, js.Pointer(&ret), 1521 ) 1522 return 1523 } 1524 1525 // HasFuncGenerateRequest returns true if the method "MediaKeySession.generateRequest" exists. 1526 func (this MediaKeySession) HasFuncGenerateRequest() bool { 1527 return js.True == bindings.HasFuncMediaKeySessionGenerateRequest( 1528 this.ref, 1529 ) 1530 } 1531 1532 // FuncGenerateRequest returns the method "MediaKeySession.generateRequest". 1533 func (this MediaKeySession) FuncGenerateRequest() (fn js.Func[func(initDataType js.String, initData BufferSource) js.Promise[js.Void]]) { 1534 bindings.FuncMediaKeySessionGenerateRequest( 1535 this.ref, js.Pointer(&fn), 1536 ) 1537 return 1538 } 1539 1540 // GenerateRequest calls the method "MediaKeySession.generateRequest". 1541 func (this MediaKeySession) GenerateRequest(initDataType js.String, initData BufferSource) (ret js.Promise[js.Void]) { 1542 bindings.CallMediaKeySessionGenerateRequest( 1543 this.ref, js.Pointer(&ret), 1544 initDataType.Ref(), 1545 initData.Ref(), 1546 ) 1547 1548 return 1549 } 1550 1551 // TryGenerateRequest calls the method "MediaKeySession.generateRequest" 1552 // in a try/catch block and returns (_, err, ok = false) when it went through 1553 // the catch clause. 1554 func (this MediaKeySession) TryGenerateRequest(initDataType js.String, initData BufferSource) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1555 ok = js.True == bindings.TryMediaKeySessionGenerateRequest( 1556 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1557 initDataType.Ref(), 1558 initData.Ref(), 1559 ) 1560 1561 return 1562 } 1563 1564 // HasFuncLoad returns true if the method "MediaKeySession.load" exists. 1565 func (this MediaKeySession) HasFuncLoad() bool { 1566 return js.True == bindings.HasFuncMediaKeySessionLoad( 1567 this.ref, 1568 ) 1569 } 1570 1571 // FuncLoad returns the method "MediaKeySession.load". 1572 func (this MediaKeySession) FuncLoad() (fn js.Func[func(sessionId js.String) js.Promise[js.Boolean]]) { 1573 bindings.FuncMediaKeySessionLoad( 1574 this.ref, js.Pointer(&fn), 1575 ) 1576 return 1577 } 1578 1579 // Load calls the method "MediaKeySession.load". 1580 func (this MediaKeySession) Load(sessionId js.String) (ret js.Promise[js.Boolean]) { 1581 bindings.CallMediaKeySessionLoad( 1582 this.ref, js.Pointer(&ret), 1583 sessionId.Ref(), 1584 ) 1585 1586 return 1587 } 1588 1589 // TryLoad calls the method "MediaKeySession.load" 1590 // in a try/catch block and returns (_, err, ok = false) when it went through 1591 // the catch clause. 1592 func (this MediaKeySession) TryLoad(sessionId js.String) (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 1593 ok = js.True == bindings.TryMediaKeySessionLoad( 1594 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1595 sessionId.Ref(), 1596 ) 1597 1598 return 1599 } 1600 1601 // HasFuncUpdate returns true if the method "MediaKeySession.update" exists. 1602 func (this MediaKeySession) HasFuncUpdate() bool { 1603 return js.True == bindings.HasFuncMediaKeySessionUpdate( 1604 this.ref, 1605 ) 1606 } 1607 1608 // FuncUpdate returns the method "MediaKeySession.update". 1609 func (this MediaKeySession) FuncUpdate() (fn js.Func[func(response BufferSource) js.Promise[js.Void]]) { 1610 bindings.FuncMediaKeySessionUpdate( 1611 this.ref, js.Pointer(&fn), 1612 ) 1613 return 1614 } 1615 1616 // Update calls the method "MediaKeySession.update". 1617 func (this MediaKeySession) Update(response BufferSource) (ret js.Promise[js.Void]) { 1618 bindings.CallMediaKeySessionUpdate( 1619 this.ref, js.Pointer(&ret), 1620 response.Ref(), 1621 ) 1622 1623 return 1624 } 1625 1626 // TryUpdate calls the method "MediaKeySession.update" 1627 // in a try/catch block and returns (_, err, ok = false) when it went through 1628 // the catch clause. 1629 func (this MediaKeySession) TryUpdate(response BufferSource) (ret js.Promise[js.Void], exception js.Any, ok bool) { 1630 ok = js.True == bindings.TryMediaKeySessionUpdate( 1631 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1632 response.Ref(), 1633 ) 1634 1635 return 1636 } 1637 1638 // HasFuncClose returns true if the method "MediaKeySession.close" exists. 1639 func (this MediaKeySession) HasFuncClose() bool { 1640 return js.True == bindings.HasFuncMediaKeySessionClose( 1641 this.ref, 1642 ) 1643 } 1644 1645 // FuncClose returns the method "MediaKeySession.close". 1646 func (this MediaKeySession) FuncClose() (fn js.Func[func() js.Promise[js.Void]]) { 1647 bindings.FuncMediaKeySessionClose( 1648 this.ref, js.Pointer(&fn), 1649 ) 1650 return 1651 } 1652 1653 // Close calls the method "MediaKeySession.close". 1654 func (this MediaKeySession) Close() (ret js.Promise[js.Void]) { 1655 bindings.CallMediaKeySessionClose( 1656 this.ref, js.Pointer(&ret), 1657 ) 1658 1659 return 1660 } 1661 1662 // TryClose calls the method "MediaKeySession.close" 1663 // in a try/catch block and returns (_, err, ok = false) when it went through 1664 // the catch clause. 1665 func (this MediaKeySession) TryClose() (ret js.Promise[js.Void], exception js.Any, ok bool) { 1666 ok = js.True == bindings.TryMediaKeySessionClose( 1667 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1668 ) 1669 1670 return 1671 } 1672 1673 // HasFuncRemove returns true if the method "MediaKeySession.remove" exists. 1674 func (this MediaKeySession) HasFuncRemove() bool { 1675 return js.True == bindings.HasFuncMediaKeySessionRemove( 1676 this.ref, 1677 ) 1678 } 1679 1680 // FuncRemove returns the method "MediaKeySession.remove". 1681 func (this MediaKeySession) FuncRemove() (fn js.Func[func() js.Promise[js.Void]]) { 1682 bindings.FuncMediaKeySessionRemove( 1683 this.ref, js.Pointer(&fn), 1684 ) 1685 return 1686 } 1687 1688 // Remove calls the method "MediaKeySession.remove". 1689 func (this MediaKeySession) Remove() (ret js.Promise[js.Void]) { 1690 bindings.CallMediaKeySessionRemove( 1691 this.ref, js.Pointer(&ret), 1692 ) 1693 1694 return 1695 } 1696 1697 // TryRemove calls the method "MediaKeySession.remove" 1698 // in a try/catch block and returns (_, err, ok = false) when it went through 1699 // the catch clause. 1700 func (this MediaKeySession) TryRemove() (ret js.Promise[js.Void], exception js.Any, ok bool) { 1701 ok = js.True == bindings.TryMediaKeySessionRemove( 1702 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1703 ) 1704 1705 return 1706 } 1707 1708 type MediaKeySessionType uint32 1709 1710 const ( 1711 _ MediaKeySessionType = iota 1712 1713 MediaKeySessionType_TEMPORARY 1714 MediaKeySessionType_PERSISTENT_LICENSE 1715 ) 1716 1717 func (MediaKeySessionType) FromRef(str js.Ref) MediaKeySessionType { 1718 return MediaKeySessionType(bindings.ConstOfMediaKeySessionType(str)) 1719 } 1720 1721 func (x MediaKeySessionType) String() (string, bool) { 1722 switch x { 1723 case MediaKeySessionType_TEMPORARY: 1724 return "temporary", true 1725 case MediaKeySessionType_PERSISTENT_LICENSE: 1726 return "persistent-license", true 1727 default: 1728 return "", false 1729 } 1730 } 1731 1732 type MediaKeys struct { 1733 ref js.Ref 1734 } 1735 1736 func (this MediaKeys) Once() MediaKeys { 1737 this.ref.Once() 1738 return this 1739 } 1740 1741 func (this MediaKeys) Ref() js.Ref { 1742 return this.ref 1743 } 1744 1745 func (this MediaKeys) FromRef(ref js.Ref) MediaKeys { 1746 this.ref = ref 1747 return this 1748 } 1749 1750 func (this MediaKeys) Free() { 1751 this.ref.Free() 1752 } 1753 1754 // HasFuncCreateSession returns true if the method "MediaKeys.createSession" exists. 1755 func (this MediaKeys) HasFuncCreateSession() bool { 1756 return js.True == bindings.HasFuncMediaKeysCreateSession( 1757 this.ref, 1758 ) 1759 } 1760 1761 // FuncCreateSession returns the method "MediaKeys.createSession". 1762 func (this MediaKeys) FuncCreateSession() (fn js.Func[func(sessionType MediaKeySessionType) MediaKeySession]) { 1763 bindings.FuncMediaKeysCreateSession( 1764 this.ref, js.Pointer(&fn), 1765 ) 1766 return 1767 } 1768 1769 // CreateSession calls the method "MediaKeys.createSession". 1770 func (this MediaKeys) CreateSession(sessionType MediaKeySessionType) (ret MediaKeySession) { 1771 bindings.CallMediaKeysCreateSession( 1772 this.ref, js.Pointer(&ret), 1773 uint32(sessionType), 1774 ) 1775 1776 return 1777 } 1778 1779 // TryCreateSession calls the method "MediaKeys.createSession" 1780 // in a try/catch block and returns (_, err, ok = false) when it went through 1781 // the catch clause. 1782 func (this MediaKeys) TryCreateSession(sessionType MediaKeySessionType) (ret MediaKeySession, exception js.Any, ok bool) { 1783 ok = js.True == bindings.TryMediaKeysCreateSession( 1784 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1785 uint32(sessionType), 1786 ) 1787 1788 return 1789 } 1790 1791 // HasFuncCreateSession1 returns true if the method "MediaKeys.createSession" exists. 1792 func (this MediaKeys) HasFuncCreateSession1() bool { 1793 return js.True == bindings.HasFuncMediaKeysCreateSession1( 1794 this.ref, 1795 ) 1796 } 1797 1798 // FuncCreateSession1 returns the method "MediaKeys.createSession". 1799 func (this MediaKeys) FuncCreateSession1() (fn js.Func[func() MediaKeySession]) { 1800 bindings.FuncMediaKeysCreateSession1( 1801 this.ref, js.Pointer(&fn), 1802 ) 1803 return 1804 } 1805 1806 // CreateSession1 calls the method "MediaKeys.createSession". 1807 func (this MediaKeys) CreateSession1() (ret MediaKeySession) { 1808 bindings.CallMediaKeysCreateSession1( 1809 this.ref, js.Pointer(&ret), 1810 ) 1811 1812 return 1813 } 1814 1815 // TryCreateSession1 calls the method "MediaKeys.createSession" 1816 // in a try/catch block and returns (_, err, ok = false) when it went through 1817 // the catch clause. 1818 func (this MediaKeys) TryCreateSession1() (ret MediaKeySession, exception js.Any, ok bool) { 1819 ok = js.True == bindings.TryMediaKeysCreateSession1( 1820 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1821 ) 1822 1823 return 1824 } 1825 1826 // HasFuncSetServerCertificate returns true if the method "MediaKeys.setServerCertificate" exists. 1827 func (this MediaKeys) HasFuncSetServerCertificate() bool { 1828 return js.True == bindings.HasFuncMediaKeysSetServerCertificate( 1829 this.ref, 1830 ) 1831 } 1832 1833 // FuncSetServerCertificate returns the method "MediaKeys.setServerCertificate". 1834 func (this MediaKeys) FuncSetServerCertificate() (fn js.Func[func(serverCertificate BufferSource) js.Promise[js.Boolean]]) { 1835 bindings.FuncMediaKeysSetServerCertificate( 1836 this.ref, js.Pointer(&fn), 1837 ) 1838 return 1839 } 1840 1841 // SetServerCertificate calls the method "MediaKeys.setServerCertificate". 1842 func (this MediaKeys) SetServerCertificate(serverCertificate BufferSource) (ret js.Promise[js.Boolean]) { 1843 bindings.CallMediaKeysSetServerCertificate( 1844 this.ref, js.Pointer(&ret), 1845 serverCertificate.Ref(), 1846 ) 1847 1848 return 1849 } 1850 1851 // TrySetServerCertificate calls the method "MediaKeys.setServerCertificate" 1852 // in a try/catch block and returns (_, err, ok = false) when it went through 1853 // the catch clause. 1854 func (this MediaKeys) TrySetServerCertificate(serverCertificate BufferSource) (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 1855 ok = js.True == bindings.TryMediaKeysSetServerCertificate( 1856 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1857 serverCertificate.Ref(), 1858 ) 1859 1860 return 1861 } 1862 1863 type ULongRange struct { 1864 // Max is "ULongRange.max" 1865 // 1866 // Optional 1867 // 1868 // NOTE: FFI_USE_Max MUST be set to true to make this field effective. 1869 Max uint32 1870 // Min is "ULongRange.min" 1871 // 1872 // Optional 1873 // 1874 // NOTE: FFI_USE_Min MUST be set to true to make this field effective. 1875 Min uint32 1876 1877 FFI_USE_Max bool // for Max. 1878 FFI_USE_Min bool // for Min. 1879 1880 FFI_USE bool 1881 } 1882 1883 // FromRef calls UpdateFrom and returns a ULongRange with all fields set. 1884 func (p ULongRange) FromRef(ref js.Ref) ULongRange { 1885 p.UpdateFrom(ref) 1886 return p 1887 } 1888 1889 // New creates a new ULongRange in the application heap. 1890 func (p ULongRange) New() js.Ref { 1891 return bindings.ULongRangeJSLoad( 1892 js.Pointer(&p), js.True, 0, 1893 ) 1894 } 1895 1896 // UpdateFrom copies value of all fields of the heap object to p. 1897 func (p *ULongRange) UpdateFrom(ref js.Ref) { 1898 bindings.ULongRangeJSStore( 1899 js.Pointer(p), ref, 1900 ) 1901 } 1902 1903 // Update writes all fields of the p to the heap object referenced by ref. 1904 func (p *ULongRange) Update(ref js.Ref) { 1905 bindings.ULongRangeJSLoad( 1906 js.Pointer(p), js.False, ref, 1907 ) 1908 } 1909 1910 // FreeMembers frees fields with heap reference, if recursive is true 1911 // free all heap references reachable from p. 1912 func (p *ULongRange) FreeMembers(recursive bool) { 1913 } 1914 1915 type DoubleRange struct { 1916 // Max is "DoubleRange.max" 1917 // 1918 // Optional 1919 // 1920 // NOTE: FFI_USE_Max MUST be set to true to make this field effective. 1921 Max float64 1922 // Min is "DoubleRange.min" 1923 // 1924 // Optional 1925 // 1926 // NOTE: FFI_USE_Min MUST be set to true to make this field effective. 1927 Min float64 1928 1929 FFI_USE_Max bool // for Max. 1930 FFI_USE_Min bool // for Min. 1931 1932 FFI_USE bool 1933 } 1934 1935 // FromRef calls UpdateFrom and returns a DoubleRange with all fields set. 1936 func (p DoubleRange) FromRef(ref js.Ref) DoubleRange { 1937 p.UpdateFrom(ref) 1938 return p 1939 } 1940 1941 // New creates a new DoubleRange in the application heap. 1942 func (p DoubleRange) New() js.Ref { 1943 return bindings.DoubleRangeJSLoad( 1944 js.Pointer(&p), js.True, 0, 1945 ) 1946 } 1947 1948 // UpdateFrom copies value of all fields of the heap object to p. 1949 func (p *DoubleRange) UpdateFrom(ref js.Ref) { 1950 bindings.DoubleRangeJSStore( 1951 js.Pointer(p), ref, 1952 ) 1953 } 1954 1955 // Update writes all fields of the p to the heap object referenced by ref. 1956 func (p *DoubleRange) Update(ref js.Ref) { 1957 bindings.DoubleRangeJSLoad( 1958 js.Pointer(p), js.False, ref, 1959 ) 1960 } 1961 1962 // FreeMembers frees fields with heap reference, if recursive is true 1963 // free all heap references reachable from p. 1964 func (p *DoubleRange) FreeMembers(recursive bool) { 1965 } 1966 1967 type MediaSettingsRange struct { 1968 // Max is "MediaSettingsRange.max" 1969 // 1970 // Optional 1971 // 1972 // NOTE: FFI_USE_Max MUST be set to true to make this field effective. 1973 Max float64 1974 // Min is "MediaSettingsRange.min" 1975 // 1976 // Optional 1977 // 1978 // NOTE: FFI_USE_Min MUST be set to true to make this field effective. 1979 Min float64 1980 // Step is "MediaSettingsRange.step" 1981 // 1982 // Optional 1983 // 1984 // NOTE: FFI_USE_Step MUST be set to true to make this field effective. 1985 Step float64 1986 1987 FFI_USE_Max bool // for Max. 1988 FFI_USE_Min bool // for Min. 1989 FFI_USE_Step bool // for Step. 1990 1991 FFI_USE bool 1992 } 1993 1994 // FromRef calls UpdateFrom and returns a MediaSettingsRange with all fields set. 1995 func (p MediaSettingsRange) FromRef(ref js.Ref) MediaSettingsRange { 1996 p.UpdateFrom(ref) 1997 return p 1998 } 1999 2000 // New creates a new MediaSettingsRange in the application heap. 2001 func (p MediaSettingsRange) New() js.Ref { 2002 return bindings.MediaSettingsRangeJSLoad( 2003 js.Pointer(&p), js.True, 0, 2004 ) 2005 } 2006 2007 // UpdateFrom copies value of all fields of the heap object to p. 2008 func (p *MediaSettingsRange) UpdateFrom(ref js.Ref) { 2009 bindings.MediaSettingsRangeJSStore( 2010 js.Pointer(p), ref, 2011 ) 2012 } 2013 2014 // Update writes all fields of the p to the heap object referenced by ref. 2015 func (p *MediaSettingsRange) Update(ref js.Ref) { 2016 bindings.MediaSettingsRangeJSLoad( 2017 js.Pointer(p), js.False, ref, 2018 ) 2019 } 2020 2021 // FreeMembers frees fields with heap reference, if recursive is true 2022 // free all heap references reachable from p. 2023 func (p *MediaSettingsRange) FreeMembers(recursive bool) { 2024 } 2025 2026 type MediaTrackCapabilities struct { 2027 // Width is "MediaTrackCapabilities.width" 2028 // 2029 // Optional 2030 // 2031 // NOTE: Width.FFI_USE MUST be set to true to get Width used. 2032 Width ULongRange 2033 // Height is "MediaTrackCapabilities.height" 2034 // 2035 // Optional 2036 // 2037 // NOTE: Height.FFI_USE MUST be set to true to get Height used. 2038 Height ULongRange 2039 // AspectRatio is "MediaTrackCapabilities.aspectRatio" 2040 // 2041 // Optional 2042 // 2043 // NOTE: AspectRatio.FFI_USE MUST be set to true to get AspectRatio used. 2044 AspectRatio DoubleRange 2045 // FrameRate is "MediaTrackCapabilities.frameRate" 2046 // 2047 // Optional 2048 // 2049 // NOTE: FrameRate.FFI_USE MUST be set to true to get FrameRate used. 2050 FrameRate DoubleRange 2051 // FacingMode is "MediaTrackCapabilities.facingMode" 2052 // 2053 // Optional 2054 FacingMode js.Array[js.String] 2055 // ResizeMode is "MediaTrackCapabilities.resizeMode" 2056 // 2057 // Optional 2058 ResizeMode js.Array[js.String] 2059 // SampleRate is "MediaTrackCapabilities.sampleRate" 2060 // 2061 // Optional 2062 // 2063 // NOTE: SampleRate.FFI_USE MUST be set to true to get SampleRate used. 2064 SampleRate ULongRange 2065 // SampleSize is "MediaTrackCapabilities.sampleSize" 2066 // 2067 // Optional 2068 // 2069 // NOTE: SampleSize.FFI_USE MUST be set to true to get SampleSize used. 2070 SampleSize ULongRange 2071 // EchoCancellation is "MediaTrackCapabilities.echoCancellation" 2072 // 2073 // Optional 2074 EchoCancellation js.Array[bool] 2075 // AutoGainControl is "MediaTrackCapabilities.autoGainControl" 2076 // 2077 // Optional 2078 AutoGainControl js.Array[bool] 2079 // NoiseSuppression is "MediaTrackCapabilities.noiseSuppression" 2080 // 2081 // Optional 2082 NoiseSuppression js.Array[bool] 2083 // Latency is "MediaTrackCapabilities.latency" 2084 // 2085 // Optional 2086 // 2087 // NOTE: Latency.FFI_USE MUST be set to true to get Latency used. 2088 Latency DoubleRange 2089 // ChannelCount is "MediaTrackCapabilities.channelCount" 2090 // 2091 // Optional 2092 // 2093 // NOTE: ChannelCount.FFI_USE MUST be set to true to get ChannelCount used. 2094 ChannelCount ULongRange 2095 // DeviceId is "MediaTrackCapabilities.deviceId" 2096 // 2097 // Optional 2098 DeviceId js.String 2099 // GroupId is "MediaTrackCapabilities.groupId" 2100 // 2101 // Optional 2102 GroupId js.String 2103 // WhiteBalanceMode is "MediaTrackCapabilities.whiteBalanceMode" 2104 // 2105 // Optional 2106 WhiteBalanceMode js.Array[js.String] 2107 // ExposureMode is "MediaTrackCapabilities.exposureMode" 2108 // 2109 // Optional 2110 ExposureMode js.Array[js.String] 2111 // FocusMode is "MediaTrackCapabilities.focusMode" 2112 // 2113 // Optional 2114 FocusMode js.Array[js.String] 2115 // ExposureCompensation is "MediaTrackCapabilities.exposureCompensation" 2116 // 2117 // Optional 2118 // 2119 // NOTE: ExposureCompensation.FFI_USE MUST be set to true to get ExposureCompensation used. 2120 ExposureCompensation MediaSettingsRange 2121 // ExposureTime is "MediaTrackCapabilities.exposureTime" 2122 // 2123 // Optional 2124 // 2125 // NOTE: ExposureTime.FFI_USE MUST be set to true to get ExposureTime used. 2126 ExposureTime MediaSettingsRange 2127 // ColorTemperature is "MediaTrackCapabilities.colorTemperature" 2128 // 2129 // Optional 2130 // 2131 // NOTE: ColorTemperature.FFI_USE MUST be set to true to get ColorTemperature used. 2132 ColorTemperature MediaSettingsRange 2133 // Iso is "MediaTrackCapabilities.iso" 2134 // 2135 // Optional 2136 // 2137 // NOTE: Iso.FFI_USE MUST be set to true to get Iso used. 2138 Iso MediaSettingsRange 2139 // Brightness is "MediaTrackCapabilities.brightness" 2140 // 2141 // Optional 2142 // 2143 // NOTE: Brightness.FFI_USE MUST be set to true to get Brightness used. 2144 Brightness MediaSettingsRange 2145 // Contrast is "MediaTrackCapabilities.contrast" 2146 // 2147 // Optional 2148 // 2149 // NOTE: Contrast.FFI_USE MUST be set to true to get Contrast used. 2150 Contrast MediaSettingsRange 2151 // Saturation is "MediaTrackCapabilities.saturation" 2152 // 2153 // Optional 2154 // 2155 // NOTE: Saturation.FFI_USE MUST be set to true to get Saturation used. 2156 Saturation MediaSettingsRange 2157 // Sharpness is "MediaTrackCapabilities.sharpness" 2158 // 2159 // Optional 2160 // 2161 // NOTE: Sharpness.FFI_USE MUST be set to true to get Sharpness used. 2162 Sharpness MediaSettingsRange 2163 // FocusDistance is "MediaTrackCapabilities.focusDistance" 2164 // 2165 // Optional 2166 // 2167 // NOTE: FocusDistance.FFI_USE MUST be set to true to get FocusDistance used. 2168 FocusDistance MediaSettingsRange 2169 // Pan is "MediaTrackCapabilities.pan" 2170 // 2171 // Optional 2172 // 2173 // NOTE: Pan.FFI_USE MUST be set to true to get Pan used. 2174 Pan MediaSettingsRange 2175 // Tilt is "MediaTrackCapabilities.tilt" 2176 // 2177 // Optional 2178 // 2179 // NOTE: Tilt.FFI_USE MUST be set to true to get Tilt used. 2180 Tilt MediaSettingsRange 2181 // Zoom is "MediaTrackCapabilities.zoom" 2182 // 2183 // Optional 2184 // 2185 // NOTE: Zoom.FFI_USE MUST be set to true to get Zoom used. 2186 Zoom MediaSettingsRange 2187 // Torch is "MediaTrackCapabilities.torch" 2188 // 2189 // Optional 2190 // 2191 // NOTE: FFI_USE_Torch MUST be set to true to make this field effective. 2192 Torch bool 2193 // DisplaySurface is "MediaTrackCapabilities.displaySurface" 2194 // 2195 // Optional 2196 DisplaySurface js.String 2197 // LogicalSurface is "MediaTrackCapabilities.logicalSurface" 2198 // 2199 // Optional 2200 // 2201 // NOTE: FFI_USE_LogicalSurface MUST be set to true to make this field effective. 2202 LogicalSurface bool 2203 // Cursor is "MediaTrackCapabilities.cursor" 2204 // 2205 // Optional 2206 Cursor js.Array[js.String] 2207 2208 FFI_USE_Torch bool // for Torch. 2209 FFI_USE_LogicalSurface bool // for LogicalSurface. 2210 2211 FFI_USE bool 2212 } 2213 2214 // FromRef calls UpdateFrom and returns a MediaTrackCapabilities with all fields set. 2215 func (p MediaTrackCapabilities) FromRef(ref js.Ref) MediaTrackCapabilities { 2216 p.UpdateFrom(ref) 2217 return p 2218 } 2219 2220 // New creates a new MediaTrackCapabilities in the application heap. 2221 func (p MediaTrackCapabilities) New() js.Ref { 2222 return bindings.MediaTrackCapabilitiesJSLoad( 2223 js.Pointer(&p), js.True, 0, 2224 ) 2225 } 2226 2227 // UpdateFrom copies value of all fields of the heap object to p. 2228 func (p *MediaTrackCapabilities) UpdateFrom(ref js.Ref) { 2229 bindings.MediaTrackCapabilitiesJSStore( 2230 js.Pointer(p), ref, 2231 ) 2232 } 2233 2234 // Update writes all fields of the p to the heap object referenced by ref. 2235 func (p *MediaTrackCapabilities) Update(ref js.Ref) { 2236 bindings.MediaTrackCapabilitiesJSLoad( 2237 js.Pointer(p), js.False, ref, 2238 ) 2239 } 2240 2241 // FreeMembers frees fields with heap reference, if recursive is true 2242 // free all heap references reachable from p. 2243 func (p *MediaTrackCapabilities) FreeMembers(recursive bool) { 2244 js.Free( 2245 p.FacingMode.Ref(), 2246 p.ResizeMode.Ref(), 2247 p.EchoCancellation.Ref(), 2248 p.AutoGainControl.Ref(), 2249 p.NoiseSuppression.Ref(), 2250 p.DeviceId.Ref(), 2251 p.GroupId.Ref(), 2252 p.WhiteBalanceMode.Ref(), 2253 p.ExposureMode.Ref(), 2254 p.FocusMode.Ref(), 2255 p.DisplaySurface.Ref(), 2256 p.Cursor.Ref(), 2257 ) 2258 p.FacingMode = p.FacingMode.FromRef(js.Undefined) 2259 p.ResizeMode = p.ResizeMode.FromRef(js.Undefined) 2260 p.EchoCancellation = p.EchoCancellation.FromRef(js.Undefined) 2261 p.AutoGainControl = p.AutoGainControl.FromRef(js.Undefined) 2262 p.NoiseSuppression = p.NoiseSuppression.FromRef(js.Undefined) 2263 p.DeviceId = p.DeviceId.FromRef(js.Undefined) 2264 p.GroupId = p.GroupId.FromRef(js.Undefined) 2265 p.WhiteBalanceMode = p.WhiteBalanceMode.FromRef(js.Undefined) 2266 p.ExposureMode = p.ExposureMode.FromRef(js.Undefined) 2267 p.FocusMode = p.FocusMode.FromRef(js.Undefined) 2268 p.DisplaySurface = p.DisplaySurface.FromRef(js.Undefined) 2269 p.Cursor = p.Cursor.FromRef(js.Undefined) 2270 if recursive { 2271 p.Width.FreeMembers(true) 2272 p.Height.FreeMembers(true) 2273 p.AspectRatio.FreeMembers(true) 2274 p.FrameRate.FreeMembers(true) 2275 p.SampleRate.FreeMembers(true) 2276 p.SampleSize.FreeMembers(true) 2277 p.Latency.FreeMembers(true) 2278 p.ChannelCount.FreeMembers(true) 2279 p.ExposureCompensation.FreeMembers(true) 2280 p.ExposureTime.FreeMembers(true) 2281 p.ColorTemperature.FreeMembers(true) 2282 p.Iso.FreeMembers(true) 2283 p.Brightness.FreeMembers(true) 2284 p.Contrast.FreeMembers(true) 2285 p.Saturation.FreeMembers(true) 2286 p.Sharpness.FreeMembers(true) 2287 p.FocusDistance.FreeMembers(true) 2288 p.Pan.FreeMembers(true) 2289 p.Tilt.FreeMembers(true) 2290 p.Zoom.FreeMembers(true) 2291 } 2292 } 2293 2294 type ConstrainULongRange struct { 2295 // Exact is "ConstrainULongRange.exact" 2296 // 2297 // Optional 2298 // 2299 // NOTE: FFI_USE_Exact MUST be set to true to make this field effective. 2300 Exact uint32 2301 // Ideal is "ConstrainULongRange.ideal" 2302 // 2303 // Optional 2304 // 2305 // NOTE: FFI_USE_Ideal MUST be set to true to make this field effective. 2306 Ideal uint32 2307 // Max is "ConstrainULongRange.max" 2308 // 2309 // Optional 2310 // 2311 // NOTE: FFI_USE_Max MUST be set to true to make this field effective. 2312 Max uint32 2313 // Min is "ConstrainULongRange.min" 2314 // 2315 // Optional 2316 // 2317 // NOTE: FFI_USE_Min MUST be set to true to make this field effective. 2318 Min uint32 2319 2320 FFI_USE_Exact bool // for Exact. 2321 FFI_USE_Ideal bool // for Ideal. 2322 FFI_USE_Max bool // for Max. 2323 FFI_USE_Min bool // for Min. 2324 2325 FFI_USE bool 2326 } 2327 2328 // FromRef calls UpdateFrom and returns a ConstrainULongRange with all fields set. 2329 func (p ConstrainULongRange) FromRef(ref js.Ref) ConstrainULongRange { 2330 p.UpdateFrom(ref) 2331 return p 2332 } 2333 2334 // New creates a new ConstrainULongRange in the application heap. 2335 func (p ConstrainULongRange) New() js.Ref { 2336 return bindings.ConstrainULongRangeJSLoad( 2337 js.Pointer(&p), js.True, 0, 2338 ) 2339 } 2340 2341 // UpdateFrom copies value of all fields of the heap object to p. 2342 func (p *ConstrainULongRange) UpdateFrom(ref js.Ref) { 2343 bindings.ConstrainULongRangeJSStore( 2344 js.Pointer(p), ref, 2345 ) 2346 } 2347 2348 // Update writes all fields of the p to the heap object referenced by ref. 2349 func (p *ConstrainULongRange) Update(ref js.Ref) { 2350 bindings.ConstrainULongRangeJSLoad( 2351 js.Pointer(p), js.False, ref, 2352 ) 2353 } 2354 2355 // FreeMembers frees fields with heap reference, if recursive is true 2356 // free all heap references reachable from p. 2357 func (p *ConstrainULongRange) FreeMembers(recursive bool) { 2358 } 2359 2360 type OneOf_Uint32_ConstrainULongRange struct { 2361 ref js.Ref 2362 } 2363 2364 func (x OneOf_Uint32_ConstrainULongRange) Ref() js.Ref { 2365 return x.ref 2366 } 2367 2368 func (x OneOf_Uint32_ConstrainULongRange) Free() { 2369 x.ref.Free() 2370 } 2371 2372 func (x OneOf_Uint32_ConstrainULongRange) FromRef(ref js.Ref) OneOf_Uint32_ConstrainULongRange { 2373 return OneOf_Uint32_ConstrainULongRange{ 2374 ref: ref, 2375 } 2376 } 2377 2378 func (x OneOf_Uint32_ConstrainULongRange) Uint32() uint32 { 2379 return js.Number[uint32]{}.FromRef(x.ref).Get() 2380 } 2381 2382 func (x OneOf_Uint32_ConstrainULongRange) ConstrainULongRange() ConstrainULongRange { 2383 var ret ConstrainULongRange 2384 ret.UpdateFrom(x.ref) 2385 return ret 2386 } 2387 2388 type ConstrainULong = OneOf_Uint32_ConstrainULongRange 2389 2390 type ConstrainDoubleRange struct { 2391 // Exact is "ConstrainDoubleRange.exact" 2392 // 2393 // Optional 2394 // 2395 // NOTE: FFI_USE_Exact MUST be set to true to make this field effective. 2396 Exact float64 2397 // Ideal is "ConstrainDoubleRange.ideal" 2398 // 2399 // Optional 2400 // 2401 // NOTE: FFI_USE_Ideal MUST be set to true to make this field effective. 2402 Ideal float64 2403 // Max is "ConstrainDoubleRange.max" 2404 // 2405 // Optional 2406 // 2407 // NOTE: FFI_USE_Max MUST be set to true to make this field effective. 2408 Max float64 2409 // Min is "ConstrainDoubleRange.min" 2410 // 2411 // Optional 2412 // 2413 // NOTE: FFI_USE_Min MUST be set to true to make this field effective. 2414 Min float64 2415 2416 FFI_USE_Exact bool // for Exact. 2417 FFI_USE_Ideal bool // for Ideal. 2418 FFI_USE_Max bool // for Max. 2419 FFI_USE_Min bool // for Min. 2420 2421 FFI_USE bool 2422 } 2423 2424 // FromRef calls UpdateFrom and returns a ConstrainDoubleRange with all fields set. 2425 func (p ConstrainDoubleRange) FromRef(ref js.Ref) ConstrainDoubleRange { 2426 p.UpdateFrom(ref) 2427 return p 2428 } 2429 2430 // New creates a new ConstrainDoubleRange in the application heap. 2431 func (p ConstrainDoubleRange) New() js.Ref { 2432 return bindings.ConstrainDoubleRangeJSLoad( 2433 js.Pointer(&p), js.True, 0, 2434 ) 2435 } 2436 2437 // UpdateFrom copies value of all fields of the heap object to p. 2438 func (p *ConstrainDoubleRange) UpdateFrom(ref js.Ref) { 2439 bindings.ConstrainDoubleRangeJSStore( 2440 js.Pointer(p), ref, 2441 ) 2442 } 2443 2444 // Update writes all fields of the p to the heap object referenced by ref. 2445 func (p *ConstrainDoubleRange) Update(ref js.Ref) { 2446 bindings.ConstrainDoubleRangeJSLoad( 2447 js.Pointer(p), js.False, ref, 2448 ) 2449 } 2450 2451 // FreeMembers frees fields with heap reference, if recursive is true 2452 // free all heap references reachable from p. 2453 func (p *ConstrainDoubleRange) FreeMembers(recursive bool) { 2454 } 2455 2456 type OneOf_Float64_ConstrainDoubleRange struct { 2457 ref js.Ref 2458 } 2459 2460 func (x OneOf_Float64_ConstrainDoubleRange) Ref() js.Ref { 2461 return x.ref 2462 } 2463 2464 func (x OneOf_Float64_ConstrainDoubleRange) Free() { 2465 x.ref.Free() 2466 } 2467 2468 func (x OneOf_Float64_ConstrainDoubleRange) FromRef(ref js.Ref) OneOf_Float64_ConstrainDoubleRange { 2469 return OneOf_Float64_ConstrainDoubleRange{ 2470 ref: ref, 2471 } 2472 } 2473 2474 func (x OneOf_Float64_ConstrainDoubleRange) Float64() float64 { 2475 return js.Number[float64]{}.FromRef(x.ref).Get() 2476 } 2477 2478 func (x OneOf_Float64_ConstrainDoubleRange) ConstrainDoubleRange() ConstrainDoubleRange { 2479 var ret ConstrainDoubleRange 2480 ret.UpdateFrom(x.ref) 2481 return ret 2482 } 2483 2484 type ConstrainDouble = OneOf_Float64_ConstrainDoubleRange 2485 2486 type OneOf_String_ArrayString struct { 2487 ref js.Ref 2488 } 2489 2490 func (x OneOf_String_ArrayString) Ref() js.Ref { 2491 return x.ref 2492 } 2493 2494 func (x OneOf_String_ArrayString) Free() { 2495 x.ref.Free() 2496 } 2497 2498 func (x OneOf_String_ArrayString) FromRef(ref js.Ref) OneOf_String_ArrayString { 2499 return OneOf_String_ArrayString{ 2500 ref: ref, 2501 } 2502 } 2503 2504 func (x OneOf_String_ArrayString) String() js.String { 2505 return js.String{}.FromRef(x.ref) 2506 } 2507 2508 func (x OneOf_String_ArrayString) ArrayString() js.Array[js.String] { 2509 return js.Array[js.String]{}.FromRef(x.ref) 2510 } 2511 2512 type ConstrainDOMStringParameters struct { 2513 // Exact is "ConstrainDOMStringParameters.exact" 2514 // 2515 // Optional 2516 Exact OneOf_String_ArrayString 2517 // Ideal is "ConstrainDOMStringParameters.ideal" 2518 // 2519 // Optional 2520 Ideal OneOf_String_ArrayString 2521 2522 FFI_USE bool 2523 } 2524 2525 // FromRef calls UpdateFrom and returns a ConstrainDOMStringParameters with all fields set. 2526 func (p ConstrainDOMStringParameters) FromRef(ref js.Ref) ConstrainDOMStringParameters { 2527 p.UpdateFrom(ref) 2528 return p 2529 } 2530 2531 // New creates a new ConstrainDOMStringParameters in the application heap. 2532 func (p ConstrainDOMStringParameters) New() js.Ref { 2533 return bindings.ConstrainDOMStringParametersJSLoad( 2534 js.Pointer(&p), js.True, 0, 2535 ) 2536 } 2537 2538 // UpdateFrom copies value of all fields of the heap object to p. 2539 func (p *ConstrainDOMStringParameters) UpdateFrom(ref js.Ref) { 2540 bindings.ConstrainDOMStringParametersJSStore( 2541 js.Pointer(p), ref, 2542 ) 2543 } 2544 2545 // Update writes all fields of the p to the heap object referenced by ref. 2546 func (p *ConstrainDOMStringParameters) Update(ref js.Ref) { 2547 bindings.ConstrainDOMStringParametersJSLoad( 2548 js.Pointer(p), js.False, ref, 2549 ) 2550 } 2551 2552 // FreeMembers frees fields with heap reference, if recursive is true 2553 // free all heap references reachable from p. 2554 func (p *ConstrainDOMStringParameters) FreeMembers(recursive bool) { 2555 js.Free( 2556 p.Exact.Ref(), 2557 p.Ideal.Ref(), 2558 ) 2559 p.Exact = p.Exact.FromRef(js.Undefined) 2560 p.Ideal = p.Ideal.FromRef(js.Undefined) 2561 } 2562 2563 type OneOf_String_ArrayString_ConstrainDOMStringParameters struct { 2564 ref js.Ref 2565 } 2566 2567 func (x OneOf_String_ArrayString_ConstrainDOMStringParameters) Ref() js.Ref { 2568 return x.ref 2569 } 2570 2571 func (x OneOf_String_ArrayString_ConstrainDOMStringParameters) Free() { 2572 x.ref.Free() 2573 } 2574 2575 func (x OneOf_String_ArrayString_ConstrainDOMStringParameters) FromRef(ref js.Ref) OneOf_String_ArrayString_ConstrainDOMStringParameters { 2576 return OneOf_String_ArrayString_ConstrainDOMStringParameters{ 2577 ref: ref, 2578 } 2579 } 2580 2581 func (x OneOf_String_ArrayString_ConstrainDOMStringParameters) String() js.String { 2582 return js.String{}.FromRef(x.ref) 2583 } 2584 2585 func (x OneOf_String_ArrayString_ConstrainDOMStringParameters) ArrayString() js.Array[js.String] { 2586 return js.Array[js.String]{}.FromRef(x.ref) 2587 } 2588 2589 func (x OneOf_String_ArrayString_ConstrainDOMStringParameters) ConstrainDOMStringParameters() ConstrainDOMStringParameters { 2590 var ret ConstrainDOMStringParameters 2591 ret.UpdateFrom(x.ref) 2592 return ret 2593 } 2594 2595 type ConstrainDOMString = OneOf_String_ArrayString_ConstrainDOMStringParameters 2596 2597 type ConstrainBooleanParameters struct { 2598 // Exact is "ConstrainBooleanParameters.exact" 2599 // 2600 // Optional 2601 // 2602 // NOTE: FFI_USE_Exact MUST be set to true to make this field effective. 2603 Exact bool 2604 // Ideal is "ConstrainBooleanParameters.ideal" 2605 // 2606 // Optional 2607 // 2608 // NOTE: FFI_USE_Ideal MUST be set to true to make this field effective. 2609 Ideal bool 2610 2611 FFI_USE_Exact bool // for Exact. 2612 FFI_USE_Ideal bool // for Ideal. 2613 2614 FFI_USE bool 2615 } 2616 2617 // FromRef calls UpdateFrom and returns a ConstrainBooleanParameters with all fields set. 2618 func (p ConstrainBooleanParameters) FromRef(ref js.Ref) ConstrainBooleanParameters { 2619 p.UpdateFrom(ref) 2620 return p 2621 } 2622 2623 // New creates a new ConstrainBooleanParameters in the application heap. 2624 func (p ConstrainBooleanParameters) New() js.Ref { 2625 return bindings.ConstrainBooleanParametersJSLoad( 2626 js.Pointer(&p), js.True, 0, 2627 ) 2628 } 2629 2630 // UpdateFrom copies value of all fields of the heap object to p. 2631 func (p *ConstrainBooleanParameters) UpdateFrom(ref js.Ref) { 2632 bindings.ConstrainBooleanParametersJSStore( 2633 js.Pointer(p), ref, 2634 ) 2635 } 2636 2637 // Update writes all fields of the p to the heap object referenced by ref. 2638 func (p *ConstrainBooleanParameters) Update(ref js.Ref) { 2639 bindings.ConstrainBooleanParametersJSLoad( 2640 js.Pointer(p), js.False, ref, 2641 ) 2642 } 2643 2644 // FreeMembers frees fields with heap reference, if recursive is true 2645 // free all heap references reachable from p. 2646 func (p *ConstrainBooleanParameters) FreeMembers(recursive bool) { 2647 } 2648 2649 type OneOf_Bool_ConstrainBooleanParameters struct { 2650 ref js.Ref 2651 } 2652 2653 func (x OneOf_Bool_ConstrainBooleanParameters) Ref() js.Ref { 2654 return x.ref 2655 } 2656 2657 func (x OneOf_Bool_ConstrainBooleanParameters) Free() { 2658 x.ref.Free() 2659 } 2660 2661 func (x OneOf_Bool_ConstrainBooleanParameters) FromRef(ref js.Ref) OneOf_Bool_ConstrainBooleanParameters { 2662 return OneOf_Bool_ConstrainBooleanParameters{ 2663 ref: ref, 2664 } 2665 } 2666 2667 func (x OneOf_Bool_ConstrainBooleanParameters) Bool() bool { 2668 return x.ref == js.True 2669 } 2670 2671 func (x OneOf_Bool_ConstrainBooleanParameters) ConstrainBooleanParameters() ConstrainBooleanParameters { 2672 var ret ConstrainBooleanParameters 2673 ret.UpdateFrom(x.ref) 2674 return ret 2675 } 2676 2677 type ConstrainBoolean = OneOf_Bool_ConstrainBooleanParameters 2678 2679 type Point2D struct { 2680 // X is "Point2D.x" 2681 // 2682 // Optional, defaults to 0.0. 2683 // 2684 // NOTE: FFI_USE_X MUST be set to true to make this field effective. 2685 X float64 2686 // Y is "Point2D.y" 2687 // 2688 // Optional, defaults to 0.0. 2689 // 2690 // NOTE: FFI_USE_Y MUST be set to true to make this field effective. 2691 Y float64 2692 2693 FFI_USE_X bool // for X. 2694 FFI_USE_Y bool // for Y. 2695 2696 FFI_USE bool 2697 } 2698 2699 // FromRef calls UpdateFrom and returns a Point2D with all fields set. 2700 func (p Point2D) FromRef(ref js.Ref) Point2D { 2701 p.UpdateFrom(ref) 2702 return p 2703 } 2704 2705 // New creates a new Point2D in the application heap. 2706 func (p Point2D) New() js.Ref { 2707 return bindings.Point2DJSLoad( 2708 js.Pointer(&p), js.True, 0, 2709 ) 2710 } 2711 2712 // UpdateFrom copies value of all fields of the heap object to p. 2713 func (p *Point2D) UpdateFrom(ref js.Ref) { 2714 bindings.Point2DJSStore( 2715 js.Pointer(p), ref, 2716 ) 2717 } 2718 2719 // Update writes all fields of the p to the heap object referenced by ref. 2720 func (p *Point2D) Update(ref js.Ref) { 2721 bindings.Point2DJSLoad( 2722 js.Pointer(p), js.False, ref, 2723 ) 2724 } 2725 2726 // FreeMembers frees fields with heap reference, if recursive is true 2727 // free all heap references reachable from p. 2728 func (p *Point2D) FreeMembers(recursive bool) { 2729 } 2730 2731 type ConstrainPoint2DParameters struct { 2732 // Exact is "ConstrainPoint2DParameters.exact" 2733 // 2734 // Optional 2735 Exact js.Array[Point2D] 2736 // Ideal is "ConstrainPoint2DParameters.ideal" 2737 // 2738 // Optional 2739 Ideal js.Array[Point2D] 2740 2741 FFI_USE bool 2742 } 2743 2744 // FromRef calls UpdateFrom and returns a ConstrainPoint2DParameters with all fields set. 2745 func (p ConstrainPoint2DParameters) FromRef(ref js.Ref) ConstrainPoint2DParameters { 2746 p.UpdateFrom(ref) 2747 return p 2748 } 2749 2750 // New creates a new ConstrainPoint2DParameters in the application heap. 2751 func (p ConstrainPoint2DParameters) New() js.Ref { 2752 return bindings.ConstrainPoint2DParametersJSLoad( 2753 js.Pointer(&p), js.True, 0, 2754 ) 2755 } 2756 2757 // UpdateFrom copies value of all fields of the heap object to p. 2758 func (p *ConstrainPoint2DParameters) UpdateFrom(ref js.Ref) { 2759 bindings.ConstrainPoint2DParametersJSStore( 2760 js.Pointer(p), ref, 2761 ) 2762 } 2763 2764 // Update writes all fields of the p to the heap object referenced by ref. 2765 func (p *ConstrainPoint2DParameters) Update(ref js.Ref) { 2766 bindings.ConstrainPoint2DParametersJSLoad( 2767 js.Pointer(p), js.False, ref, 2768 ) 2769 } 2770 2771 // FreeMembers frees fields with heap reference, if recursive is true 2772 // free all heap references reachable from p. 2773 func (p *ConstrainPoint2DParameters) FreeMembers(recursive bool) { 2774 js.Free( 2775 p.Exact.Ref(), 2776 p.Ideal.Ref(), 2777 ) 2778 p.Exact = p.Exact.FromRef(js.Undefined) 2779 p.Ideal = p.Ideal.FromRef(js.Undefined) 2780 } 2781 2782 type OneOf_ArrayPoint2D_ConstrainPoint2DParameters struct { 2783 ref js.Ref 2784 } 2785 2786 func (x OneOf_ArrayPoint2D_ConstrainPoint2DParameters) Ref() js.Ref { 2787 return x.ref 2788 } 2789 2790 func (x OneOf_ArrayPoint2D_ConstrainPoint2DParameters) Free() { 2791 x.ref.Free() 2792 } 2793 2794 func (x OneOf_ArrayPoint2D_ConstrainPoint2DParameters) FromRef(ref js.Ref) OneOf_ArrayPoint2D_ConstrainPoint2DParameters { 2795 return OneOf_ArrayPoint2D_ConstrainPoint2DParameters{ 2796 ref: ref, 2797 } 2798 } 2799 2800 func (x OneOf_ArrayPoint2D_ConstrainPoint2DParameters) ArrayPoint2D() js.Array[Point2D] { 2801 return js.Array[Point2D]{}.FromRef(x.ref) 2802 } 2803 2804 func (x OneOf_ArrayPoint2D_ConstrainPoint2DParameters) ConstrainPoint2DParameters() ConstrainPoint2DParameters { 2805 var ret ConstrainPoint2DParameters 2806 ret.UpdateFrom(x.ref) 2807 return ret 2808 } 2809 2810 type ConstrainPoint2D = OneOf_ArrayPoint2D_ConstrainPoint2DParameters 2811 2812 type OneOf_Bool_Float64_ConstrainDoubleRange struct { 2813 ref js.Ref 2814 } 2815 2816 func (x OneOf_Bool_Float64_ConstrainDoubleRange) Ref() js.Ref { 2817 return x.ref 2818 } 2819 2820 func (x OneOf_Bool_Float64_ConstrainDoubleRange) Free() { 2821 x.ref.Free() 2822 } 2823 2824 func (x OneOf_Bool_Float64_ConstrainDoubleRange) FromRef(ref js.Ref) OneOf_Bool_Float64_ConstrainDoubleRange { 2825 return OneOf_Bool_Float64_ConstrainDoubleRange{ 2826 ref: ref, 2827 } 2828 } 2829 2830 func (x OneOf_Bool_Float64_ConstrainDoubleRange) Bool() bool { 2831 return x.ref == js.True 2832 } 2833 2834 func (x OneOf_Bool_Float64_ConstrainDoubleRange) Float64() float64 { 2835 return js.Number[float64]{}.FromRef(x.ref).Get() 2836 } 2837 2838 func (x OneOf_Bool_Float64_ConstrainDoubleRange) ConstrainDoubleRange() ConstrainDoubleRange { 2839 var ret ConstrainDoubleRange 2840 ret.UpdateFrom(x.ref) 2841 return ret 2842 } 2843 2844 type MediaTrackConstraintSet struct { 2845 // Width is "MediaTrackConstraintSet.width" 2846 // 2847 // Optional 2848 Width ConstrainULong 2849 // Height is "MediaTrackConstraintSet.height" 2850 // 2851 // Optional 2852 Height ConstrainULong 2853 // AspectRatio is "MediaTrackConstraintSet.aspectRatio" 2854 // 2855 // Optional 2856 AspectRatio ConstrainDouble 2857 // FrameRate is "MediaTrackConstraintSet.frameRate" 2858 // 2859 // Optional 2860 FrameRate ConstrainDouble 2861 // FacingMode is "MediaTrackConstraintSet.facingMode" 2862 // 2863 // Optional 2864 FacingMode ConstrainDOMString 2865 // ResizeMode is "MediaTrackConstraintSet.resizeMode" 2866 // 2867 // Optional 2868 ResizeMode ConstrainDOMString 2869 // SampleRate is "MediaTrackConstraintSet.sampleRate" 2870 // 2871 // Optional 2872 SampleRate ConstrainULong 2873 // SampleSize is "MediaTrackConstraintSet.sampleSize" 2874 // 2875 // Optional 2876 SampleSize ConstrainULong 2877 // EchoCancellation is "MediaTrackConstraintSet.echoCancellation" 2878 // 2879 // Optional 2880 EchoCancellation ConstrainBoolean 2881 // AutoGainControl is "MediaTrackConstraintSet.autoGainControl" 2882 // 2883 // Optional 2884 AutoGainControl ConstrainBoolean 2885 // NoiseSuppression is "MediaTrackConstraintSet.noiseSuppression" 2886 // 2887 // Optional 2888 NoiseSuppression ConstrainBoolean 2889 // Latency is "MediaTrackConstraintSet.latency" 2890 // 2891 // Optional 2892 Latency ConstrainDouble 2893 // ChannelCount is "MediaTrackConstraintSet.channelCount" 2894 // 2895 // Optional 2896 ChannelCount ConstrainULong 2897 // DeviceId is "MediaTrackConstraintSet.deviceId" 2898 // 2899 // Optional 2900 DeviceId ConstrainDOMString 2901 // GroupId is "MediaTrackConstraintSet.groupId" 2902 // 2903 // Optional 2904 GroupId ConstrainDOMString 2905 // WhiteBalanceMode is "MediaTrackConstraintSet.whiteBalanceMode" 2906 // 2907 // Optional 2908 WhiteBalanceMode ConstrainDOMString 2909 // ExposureMode is "MediaTrackConstraintSet.exposureMode" 2910 // 2911 // Optional 2912 ExposureMode ConstrainDOMString 2913 // FocusMode is "MediaTrackConstraintSet.focusMode" 2914 // 2915 // Optional 2916 FocusMode ConstrainDOMString 2917 // PointsOfInterest is "MediaTrackConstraintSet.pointsOfInterest" 2918 // 2919 // Optional 2920 PointsOfInterest ConstrainPoint2D 2921 // ExposureCompensation is "MediaTrackConstraintSet.exposureCompensation" 2922 // 2923 // Optional 2924 ExposureCompensation ConstrainDouble 2925 // ExposureTime is "MediaTrackConstraintSet.exposureTime" 2926 // 2927 // Optional 2928 ExposureTime ConstrainDouble 2929 // ColorTemperature is "MediaTrackConstraintSet.colorTemperature" 2930 // 2931 // Optional 2932 ColorTemperature ConstrainDouble 2933 // Iso is "MediaTrackConstraintSet.iso" 2934 // 2935 // Optional 2936 Iso ConstrainDouble 2937 // Brightness is "MediaTrackConstraintSet.brightness" 2938 // 2939 // Optional 2940 Brightness ConstrainDouble 2941 // Contrast is "MediaTrackConstraintSet.contrast" 2942 // 2943 // Optional 2944 Contrast ConstrainDouble 2945 // Saturation is "MediaTrackConstraintSet.saturation" 2946 // 2947 // Optional 2948 Saturation ConstrainDouble 2949 // Sharpness is "MediaTrackConstraintSet.sharpness" 2950 // 2951 // Optional 2952 Sharpness ConstrainDouble 2953 // FocusDistance is "MediaTrackConstraintSet.focusDistance" 2954 // 2955 // Optional 2956 FocusDistance ConstrainDouble 2957 // Pan is "MediaTrackConstraintSet.pan" 2958 // 2959 // Optional 2960 Pan OneOf_Bool_Float64_ConstrainDoubleRange 2961 // Tilt is "MediaTrackConstraintSet.tilt" 2962 // 2963 // Optional 2964 Tilt OneOf_Bool_Float64_ConstrainDoubleRange 2965 // Zoom is "MediaTrackConstraintSet.zoom" 2966 // 2967 // Optional 2968 Zoom OneOf_Bool_Float64_ConstrainDoubleRange 2969 // Torch is "MediaTrackConstraintSet.torch" 2970 // 2971 // Optional 2972 Torch ConstrainBoolean 2973 // DisplaySurface is "MediaTrackConstraintSet.displaySurface" 2974 // 2975 // Optional 2976 DisplaySurface ConstrainDOMString 2977 // LogicalSurface is "MediaTrackConstraintSet.logicalSurface" 2978 // 2979 // Optional 2980 LogicalSurface ConstrainBoolean 2981 // Cursor is "MediaTrackConstraintSet.cursor" 2982 // 2983 // Optional 2984 Cursor ConstrainDOMString 2985 // RestrictOwnAudio is "MediaTrackConstraintSet.restrictOwnAudio" 2986 // 2987 // Optional 2988 RestrictOwnAudio ConstrainBoolean 2989 // SuppressLocalAudioPlayback is "MediaTrackConstraintSet.suppressLocalAudioPlayback" 2990 // 2991 // Optional 2992 SuppressLocalAudioPlayback ConstrainBoolean 2993 2994 FFI_USE bool 2995 } 2996 2997 // FromRef calls UpdateFrom and returns a MediaTrackConstraintSet with all fields set. 2998 func (p MediaTrackConstraintSet) FromRef(ref js.Ref) MediaTrackConstraintSet { 2999 p.UpdateFrom(ref) 3000 return p 3001 } 3002 3003 // New creates a new MediaTrackConstraintSet in the application heap. 3004 func (p MediaTrackConstraintSet) New() js.Ref { 3005 return bindings.MediaTrackConstraintSetJSLoad( 3006 js.Pointer(&p), js.True, 0, 3007 ) 3008 } 3009 3010 // UpdateFrom copies value of all fields of the heap object to p. 3011 func (p *MediaTrackConstraintSet) UpdateFrom(ref js.Ref) { 3012 bindings.MediaTrackConstraintSetJSStore( 3013 js.Pointer(p), ref, 3014 ) 3015 } 3016 3017 // Update writes all fields of the p to the heap object referenced by ref. 3018 func (p *MediaTrackConstraintSet) Update(ref js.Ref) { 3019 bindings.MediaTrackConstraintSetJSLoad( 3020 js.Pointer(p), js.False, ref, 3021 ) 3022 } 3023 3024 // FreeMembers frees fields with heap reference, if recursive is true 3025 // free all heap references reachable from p. 3026 func (p *MediaTrackConstraintSet) FreeMembers(recursive bool) { 3027 js.Free( 3028 p.Width.Ref(), 3029 p.Height.Ref(), 3030 p.AspectRatio.Ref(), 3031 p.FrameRate.Ref(), 3032 p.FacingMode.Ref(), 3033 p.ResizeMode.Ref(), 3034 p.SampleRate.Ref(), 3035 p.SampleSize.Ref(), 3036 p.EchoCancellation.Ref(), 3037 p.AutoGainControl.Ref(), 3038 p.NoiseSuppression.Ref(), 3039 p.Latency.Ref(), 3040 p.ChannelCount.Ref(), 3041 p.DeviceId.Ref(), 3042 p.GroupId.Ref(), 3043 p.WhiteBalanceMode.Ref(), 3044 p.ExposureMode.Ref(), 3045 p.FocusMode.Ref(), 3046 p.PointsOfInterest.Ref(), 3047 p.ExposureCompensation.Ref(), 3048 p.ExposureTime.Ref(), 3049 p.ColorTemperature.Ref(), 3050 p.Iso.Ref(), 3051 p.Brightness.Ref(), 3052 p.Contrast.Ref(), 3053 p.Saturation.Ref(), 3054 p.Sharpness.Ref(), 3055 p.FocusDistance.Ref(), 3056 p.Pan.Ref(), 3057 p.Tilt.Ref(), 3058 p.Zoom.Ref(), 3059 p.Torch.Ref(), 3060 p.DisplaySurface.Ref(), 3061 p.LogicalSurface.Ref(), 3062 p.Cursor.Ref(), 3063 p.RestrictOwnAudio.Ref(), 3064 p.SuppressLocalAudioPlayback.Ref(), 3065 ) 3066 p.Width = p.Width.FromRef(js.Undefined) 3067 p.Height = p.Height.FromRef(js.Undefined) 3068 p.AspectRatio = p.AspectRatio.FromRef(js.Undefined) 3069 p.FrameRate = p.FrameRate.FromRef(js.Undefined) 3070 p.FacingMode = p.FacingMode.FromRef(js.Undefined) 3071 p.ResizeMode = p.ResizeMode.FromRef(js.Undefined) 3072 p.SampleRate = p.SampleRate.FromRef(js.Undefined) 3073 p.SampleSize = p.SampleSize.FromRef(js.Undefined) 3074 p.EchoCancellation = p.EchoCancellation.FromRef(js.Undefined) 3075 p.AutoGainControl = p.AutoGainControl.FromRef(js.Undefined) 3076 p.NoiseSuppression = p.NoiseSuppression.FromRef(js.Undefined) 3077 p.Latency = p.Latency.FromRef(js.Undefined) 3078 p.ChannelCount = p.ChannelCount.FromRef(js.Undefined) 3079 p.DeviceId = p.DeviceId.FromRef(js.Undefined) 3080 p.GroupId = p.GroupId.FromRef(js.Undefined) 3081 p.WhiteBalanceMode = p.WhiteBalanceMode.FromRef(js.Undefined) 3082 p.ExposureMode = p.ExposureMode.FromRef(js.Undefined) 3083 p.FocusMode = p.FocusMode.FromRef(js.Undefined) 3084 p.PointsOfInterest = p.PointsOfInterest.FromRef(js.Undefined) 3085 p.ExposureCompensation = p.ExposureCompensation.FromRef(js.Undefined) 3086 p.ExposureTime = p.ExposureTime.FromRef(js.Undefined) 3087 p.ColorTemperature = p.ColorTemperature.FromRef(js.Undefined) 3088 p.Iso = p.Iso.FromRef(js.Undefined) 3089 p.Brightness = p.Brightness.FromRef(js.Undefined) 3090 p.Contrast = p.Contrast.FromRef(js.Undefined) 3091 p.Saturation = p.Saturation.FromRef(js.Undefined) 3092 p.Sharpness = p.Sharpness.FromRef(js.Undefined) 3093 p.FocusDistance = p.FocusDistance.FromRef(js.Undefined) 3094 p.Pan = p.Pan.FromRef(js.Undefined) 3095 p.Tilt = p.Tilt.FromRef(js.Undefined) 3096 p.Zoom = p.Zoom.FromRef(js.Undefined) 3097 p.Torch = p.Torch.FromRef(js.Undefined) 3098 p.DisplaySurface = p.DisplaySurface.FromRef(js.Undefined) 3099 p.LogicalSurface = p.LogicalSurface.FromRef(js.Undefined) 3100 p.Cursor = p.Cursor.FromRef(js.Undefined) 3101 p.RestrictOwnAudio = p.RestrictOwnAudio.FromRef(js.Undefined) 3102 p.SuppressLocalAudioPlayback = p.SuppressLocalAudioPlayback.FromRef(js.Undefined) 3103 } 3104 3105 type MediaTrackConstraints struct { 3106 // Advanced is "MediaTrackConstraints.advanced" 3107 // 3108 // Optional 3109 Advanced js.Array[MediaTrackConstraintSet] 3110 // WhiteBalanceMode is "MediaTrackConstraints.whiteBalanceMode" 3111 // 3112 // Optional 3113 WhiteBalanceMode ConstrainDOMString 3114 // ExposureMode is "MediaTrackConstraints.exposureMode" 3115 // 3116 // Optional 3117 ExposureMode ConstrainDOMString 3118 // FocusMode is "MediaTrackConstraints.focusMode" 3119 // 3120 // Optional 3121 FocusMode ConstrainDOMString 3122 // PointsOfInterest is "MediaTrackConstraints.pointsOfInterest" 3123 // 3124 // Optional 3125 PointsOfInterest ConstrainPoint2D 3126 // ExposureCompensation is "MediaTrackConstraints.exposureCompensation" 3127 // 3128 // Optional 3129 ExposureCompensation ConstrainDouble 3130 // ExposureTime is "MediaTrackConstraints.exposureTime" 3131 // 3132 // Optional 3133 ExposureTime ConstrainDouble 3134 // ColorTemperature is "MediaTrackConstraints.colorTemperature" 3135 // 3136 // Optional 3137 ColorTemperature ConstrainDouble 3138 // Iso is "MediaTrackConstraints.iso" 3139 // 3140 // Optional 3141 Iso ConstrainDouble 3142 // Brightness is "MediaTrackConstraints.brightness" 3143 // 3144 // Optional 3145 Brightness ConstrainDouble 3146 // Contrast is "MediaTrackConstraints.contrast" 3147 // 3148 // Optional 3149 Contrast ConstrainDouble 3150 // Saturation is "MediaTrackConstraints.saturation" 3151 // 3152 // Optional 3153 Saturation ConstrainDouble 3154 // Sharpness is "MediaTrackConstraints.sharpness" 3155 // 3156 // Optional 3157 Sharpness ConstrainDouble 3158 // FocusDistance is "MediaTrackConstraints.focusDistance" 3159 // 3160 // Optional 3161 FocusDistance ConstrainDouble 3162 // Pan is "MediaTrackConstraints.pan" 3163 // 3164 // Optional 3165 Pan OneOf_Bool_Float64_ConstrainDoubleRange 3166 // Tilt is "MediaTrackConstraints.tilt" 3167 // 3168 // Optional 3169 Tilt OneOf_Bool_Float64_ConstrainDoubleRange 3170 // Zoom is "MediaTrackConstraints.zoom" 3171 // 3172 // Optional 3173 Zoom OneOf_Bool_Float64_ConstrainDoubleRange 3174 // Torch is "MediaTrackConstraints.torch" 3175 // 3176 // Optional 3177 Torch ConstrainBoolean 3178 3179 FFI_USE bool 3180 } 3181 3182 // FromRef calls UpdateFrom and returns a MediaTrackConstraints with all fields set. 3183 func (p MediaTrackConstraints) FromRef(ref js.Ref) MediaTrackConstraints { 3184 p.UpdateFrom(ref) 3185 return p 3186 } 3187 3188 // New creates a new MediaTrackConstraints in the application heap. 3189 func (p MediaTrackConstraints) New() js.Ref { 3190 return bindings.MediaTrackConstraintsJSLoad( 3191 js.Pointer(&p), js.True, 0, 3192 ) 3193 } 3194 3195 // UpdateFrom copies value of all fields of the heap object to p. 3196 func (p *MediaTrackConstraints) UpdateFrom(ref js.Ref) { 3197 bindings.MediaTrackConstraintsJSStore( 3198 js.Pointer(p), ref, 3199 ) 3200 } 3201 3202 // Update writes all fields of the p to the heap object referenced by ref. 3203 func (p *MediaTrackConstraints) Update(ref js.Ref) { 3204 bindings.MediaTrackConstraintsJSLoad( 3205 js.Pointer(p), js.False, ref, 3206 ) 3207 } 3208 3209 // FreeMembers frees fields with heap reference, if recursive is true 3210 // free all heap references reachable from p. 3211 func (p *MediaTrackConstraints) FreeMembers(recursive bool) { 3212 js.Free( 3213 p.Advanced.Ref(), 3214 p.WhiteBalanceMode.Ref(), 3215 p.ExposureMode.Ref(), 3216 p.FocusMode.Ref(), 3217 p.PointsOfInterest.Ref(), 3218 p.ExposureCompensation.Ref(), 3219 p.ExposureTime.Ref(), 3220 p.ColorTemperature.Ref(), 3221 p.Iso.Ref(), 3222 p.Brightness.Ref(), 3223 p.Contrast.Ref(), 3224 p.Saturation.Ref(), 3225 p.Sharpness.Ref(), 3226 p.FocusDistance.Ref(), 3227 p.Pan.Ref(), 3228 p.Tilt.Ref(), 3229 p.Zoom.Ref(), 3230 p.Torch.Ref(), 3231 ) 3232 p.Advanced = p.Advanced.FromRef(js.Undefined) 3233 p.WhiteBalanceMode = p.WhiteBalanceMode.FromRef(js.Undefined) 3234 p.ExposureMode = p.ExposureMode.FromRef(js.Undefined) 3235 p.FocusMode = p.FocusMode.FromRef(js.Undefined) 3236 p.PointsOfInterest = p.PointsOfInterest.FromRef(js.Undefined) 3237 p.ExposureCompensation = p.ExposureCompensation.FromRef(js.Undefined) 3238 p.ExposureTime = p.ExposureTime.FromRef(js.Undefined) 3239 p.ColorTemperature = p.ColorTemperature.FromRef(js.Undefined) 3240 p.Iso = p.Iso.FromRef(js.Undefined) 3241 p.Brightness = p.Brightness.FromRef(js.Undefined) 3242 p.Contrast = p.Contrast.FromRef(js.Undefined) 3243 p.Saturation = p.Saturation.FromRef(js.Undefined) 3244 p.Sharpness = p.Sharpness.FromRef(js.Undefined) 3245 p.FocusDistance = p.FocusDistance.FromRef(js.Undefined) 3246 p.Pan = p.Pan.FromRef(js.Undefined) 3247 p.Tilt = p.Tilt.FromRef(js.Undefined) 3248 p.Zoom = p.Zoom.FromRef(js.Undefined) 3249 p.Torch = p.Torch.FromRef(js.Undefined) 3250 } 3251 3252 type MediaTrackSettings struct { 3253 // Width is "MediaTrackSettings.width" 3254 // 3255 // Optional 3256 // 3257 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 3258 Width uint32 3259 // Height is "MediaTrackSettings.height" 3260 // 3261 // Optional 3262 // 3263 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 3264 Height uint32 3265 // AspectRatio is "MediaTrackSettings.aspectRatio" 3266 // 3267 // Optional 3268 // 3269 // NOTE: FFI_USE_AspectRatio MUST be set to true to make this field effective. 3270 AspectRatio float64 3271 // FrameRate is "MediaTrackSettings.frameRate" 3272 // 3273 // Optional 3274 // 3275 // NOTE: FFI_USE_FrameRate MUST be set to true to make this field effective. 3276 FrameRate float64 3277 // FacingMode is "MediaTrackSettings.facingMode" 3278 // 3279 // Optional 3280 FacingMode js.String 3281 // ResizeMode is "MediaTrackSettings.resizeMode" 3282 // 3283 // Optional 3284 ResizeMode js.String 3285 // SampleRate is "MediaTrackSettings.sampleRate" 3286 // 3287 // Optional 3288 // 3289 // NOTE: FFI_USE_SampleRate MUST be set to true to make this field effective. 3290 SampleRate uint32 3291 // SampleSize is "MediaTrackSettings.sampleSize" 3292 // 3293 // Optional 3294 // 3295 // NOTE: FFI_USE_SampleSize MUST be set to true to make this field effective. 3296 SampleSize uint32 3297 // EchoCancellation is "MediaTrackSettings.echoCancellation" 3298 // 3299 // Optional 3300 // 3301 // NOTE: FFI_USE_EchoCancellation MUST be set to true to make this field effective. 3302 EchoCancellation bool 3303 // AutoGainControl is "MediaTrackSettings.autoGainControl" 3304 // 3305 // Optional 3306 // 3307 // NOTE: FFI_USE_AutoGainControl MUST be set to true to make this field effective. 3308 AutoGainControl bool 3309 // NoiseSuppression is "MediaTrackSettings.noiseSuppression" 3310 // 3311 // Optional 3312 // 3313 // NOTE: FFI_USE_NoiseSuppression MUST be set to true to make this field effective. 3314 NoiseSuppression bool 3315 // Latency is "MediaTrackSettings.latency" 3316 // 3317 // Optional 3318 // 3319 // NOTE: FFI_USE_Latency MUST be set to true to make this field effective. 3320 Latency float64 3321 // ChannelCount is "MediaTrackSettings.channelCount" 3322 // 3323 // Optional 3324 // 3325 // NOTE: FFI_USE_ChannelCount MUST be set to true to make this field effective. 3326 ChannelCount uint32 3327 // DeviceId is "MediaTrackSettings.deviceId" 3328 // 3329 // Optional 3330 DeviceId js.String 3331 // GroupId is "MediaTrackSettings.groupId" 3332 // 3333 // Optional 3334 GroupId js.String 3335 // WhiteBalanceMode is "MediaTrackSettings.whiteBalanceMode" 3336 // 3337 // Optional 3338 WhiteBalanceMode js.String 3339 // ExposureMode is "MediaTrackSettings.exposureMode" 3340 // 3341 // Optional 3342 ExposureMode js.String 3343 // FocusMode is "MediaTrackSettings.focusMode" 3344 // 3345 // Optional 3346 FocusMode js.String 3347 // PointsOfInterest is "MediaTrackSettings.pointsOfInterest" 3348 // 3349 // Optional 3350 PointsOfInterest js.Array[Point2D] 3351 // ExposureCompensation is "MediaTrackSettings.exposureCompensation" 3352 // 3353 // Optional 3354 // 3355 // NOTE: FFI_USE_ExposureCompensation MUST be set to true to make this field effective. 3356 ExposureCompensation float64 3357 // ExposureTime is "MediaTrackSettings.exposureTime" 3358 // 3359 // Optional 3360 // 3361 // NOTE: FFI_USE_ExposureTime MUST be set to true to make this field effective. 3362 ExposureTime float64 3363 // ColorTemperature is "MediaTrackSettings.colorTemperature" 3364 // 3365 // Optional 3366 // 3367 // NOTE: FFI_USE_ColorTemperature MUST be set to true to make this field effective. 3368 ColorTemperature float64 3369 // Iso is "MediaTrackSettings.iso" 3370 // 3371 // Optional 3372 // 3373 // NOTE: FFI_USE_Iso MUST be set to true to make this field effective. 3374 Iso float64 3375 // Brightness is "MediaTrackSettings.brightness" 3376 // 3377 // Optional 3378 // 3379 // NOTE: FFI_USE_Brightness MUST be set to true to make this field effective. 3380 Brightness float64 3381 // Contrast is "MediaTrackSettings.contrast" 3382 // 3383 // Optional 3384 // 3385 // NOTE: FFI_USE_Contrast MUST be set to true to make this field effective. 3386 Contrast float64 3387 // Saturation is "MediaTrackSettings.saturation" 3388 // 3389 // Optional 3390 // 3391 // NOTE: FFI_USE_Saturation MUST be set to true to make this field effective. 3392 Saturation float64 3393 // Sharpness is "MediaTrackSettings.sharpness" 3394 // 3395 // Optional 3396 // 3397 // NOTE: FFI_USE_Sharpness MUST be set to true to make this field effective. 3398 Sharpness float64 3399 // FocusDistance is "MediaTrackSettings.focusDistance" 3400 // 3401 // Optional 3402 // 3403 // NOTE: FFI_USE_FocusDistance MUST be set to true to make this field effective. 3404 FocusDistance float64 3405 // Pan is "MediaTrackSettings.pan" 3406 // 3407 // Optional 3408 // 3409 // NOTE: FFI_USE_Pan MUST be set to true to make this field effective. 3410 Pan float64 3411 // Tilt is "MediaTrackSettings.tilt" 3412 // 3413 // Optional 3414 // 3415 // NOTE: FFI_USE_Tilt MUST be set to true to make this field effective. 3416 Tilt float64 3417 // Zoom is "MediaTrackSettings.zoom" 3418 // 3419 // Optional 3420 // 3421 // NOTE: FFI_USE_Zoom MUST be set to true to make this field effective. 3422 Zoom float64 3423 // Torch is "MediaTrackSettings.torch" 3424 // 3425 // Optional 3426 // 3427 // NOTE: FFI_USE_Torch MUST be set to true to make this field effective. 3428 Torch bool 3429 // DisplaySurface is "MediaTrackSettings.displaySurface" 3430 // 3431 // Optional 3432 DisplaySurface js.String 3433 // LogicalSurface is "MediaTrackSettings.logicalSurface" 3434 // 3435 // Optional 3436 // 3437 // NOTE: FFI_USE_LogicalSurface MUST be set to true to make this field effective. 3438 LogicalSurface bool 3439 // Cursor is "MediaTrackSettings.cursor" 3440 // 3441 // Optional 3442 Cursor js.String 3443 // RestrictOwnAudio is "MediaTrackSettings.restrictOwnAudio" 3444 // 3445 // Optional 3446 // 3447 // NOTE: FFI_USE_RestrictOwnAudio MUST be set to true to make this field effective. 3448 RestrictOwnAudio bool 3449 // SuppressLocalAudioPlayback is "MediaTrackSettings.suppressLocalAudioPlayback" 3450 // 3451 // Optional 3452 // 3453 // NOTE: FFI_USE_SuppressLocalAudioPlayback MUST be set to true to make this field effective. 3454 SuppressLocalAudioPlayback bool 3455 3456 FFI_USE_Width bool // for Width. 3457 FFI_USE_Height bool // for Height. 3458 FFI_USE_AspectRatio bool // for AspectRatio. 3459 FFI_USE_FrameRate bool // for FrameRate. 3460 FFI_USE_SampleRate bool // for SampleRate. 3461 FFI_USE_SampleSize bool // for SampleSize. 3462 FFI_USE_EchoCancellation bool // for EchoCancellation. 3463 FFI_USE_AutoGainControl bool // for AutoGainControl. 3464 FFI_USE_NoiseSuppression bool // for NoiseSuppression. 3465 FFI_USE_Latency bool // for Latency. 3466 FFI_USE_ChannelCount bool // for ChannelCount. 3467 FFI_USE_ExposureCompensation bool // for ExposureCompensation. 3468 FFI_USE_ExposureTime bool // for ExposureTime. 3469 FFI_USE_ColorTemperature bool // for ColorTemperature. 3470 FFI_USE_Iso bool // for Iso. 3471 FFI_USE_Brightness bool // for Brightness. 3472 FFI_USE_Contrast bool // for Contrast. 3473 FFI_USE_Saturation bool // for Saturation. 3474 FFI_USE_Sharpness bool // for Sharpness. 3475 FFI_USE_FocusDistance bool // for FocusDistance. 3476 FFI_USE_Pan bool // for Pan. 3477 FFI_USE_Tilt bool // for Tilt. 3478 FFI_USE_Zoom bool // for Zoom. 3479 FFI_USE_Torch bool // for Torch. 3480 FFI_USE_LogicalSurface bool // for LogicalSurface. 3481 FFI_USE_RestrictOwnAudio bool // for RestrictOwnAudio. 3482 FFI_USE_SuppressLocalAudioPlayback bool // for SuppressLocalAudioPlayback. 3483 3484 FFI_USE bool 3485 } 3486 3487 // FromRef calls UpdateFrom and returns a MediaTrackSettings with all fields set. 3488 func (p MediaTrackSettings) FromRef(ref js.Ref) MediaTrackSettings { 3489 p.UpdateFrom(ref) 3490 return p 3491 } 3492 3493 // New creates a new MediaTrackSettings in the application heap. 3494 func (p MediaTrackSettings) New() js.Ref { 3495 return bindings.MediaTrackSettingsJSLoad( 3496 js.Pointer(&p), js.True, 0, 3497 ) 3498 } 3499 3500 // UpdateFrom copies value of all fields of the heap object to p. 3501 func (p *MediaTrackSettings) UpdateFrom(ref js.Ref) { 3502 bindings.MediaTrackSettingsJSStore( 3503 js.Pointer(p), ref, 3504 ) 3505 } 3506 3507 // Update writes all fields of the p to the heap object referenced by ref. 3508 func (p *MediaTrackSettings) Update(ref js.Ref) { 3509 bindings.MediaTrackSettingsJSLoad( 3510 js.Pointer(p), js.False, ref, 3511 ) 3512 } 3513 3514 // FreeMembers frees fields with heap reference, if recursive is true 3515 // free all heap references reachable from p. 3516 func (p *MediaTrackSettings) FreeMembers(recursive bool) { 3517 js.Free( 3518 p.FacingMode.Ref(), 3519 p.ResizeMode.Ref(), 3520 p.DeviceId.Ref(), 3521 p.GroupId.Ref(), 3522 p.WhiteBalanceMode.Ref(), 3523 p.ExposureMode.Ref(), 3524 p.FocusMode.Ref(), 3525 p.PointsOfInterest.Ref(), 3526 p.DisplaySurface.Ref(), 3527 p.Cursor.Ref(), 3528 ) 3529 p.FacingMode = p.FacingMode.FromRef(js.Undefined) 3530 p.ResizeMode = p.ResizeMode.FromRef(js.Undefined) 3531 p.DeviceId = p.DeviceId.FromRef(js.Undefined) 3532 p.GroupId = p.GroupId.FromRef(js.Undefined) 3533 p.WhiteBalanceMode = p.WhiteBalanceMode.FromRef(js.Undefined) 3534 p.ExposureMode = p.ExposureMode.FromRef(js.Undefined) 3535 p.FocusMode = p.FocusMode.FromRef(js.Undefined) 3536 p.PointsOfInterest = p.PointsOfInterest.FromRef(js.Undefined) 3537 p.DisplaySurface = p.DisplaySurface.FromRef(js.Undefined) 3538 p.Cursor = p.Cursor.FromRef(js.Undefined) 3539 } 3540 3541 type CaptureAction uint32 3542 3543 const ( 3544 _ CaptureAction = iota 3545 3546 CaptureAction_NEXT 3547 CaptureAction_PREVIOUS 3548 CaptureAction_FIRST 3549 CaptureAction_LAST 3550 ) 3551 3552 func (CaptureAction) FromRef(str js.Ref) CaptureAction { 3553 return CaptureAction(bindings.ConstOfCaptureAction(str)) 3554 } 3555 3556 func (x CaptureAction) String() (string, bool) { 3557 switch x { 3558 case CaptureAction_NEXT: 3559 return "next", true 3560 case CaptureAction_PREVIOUS: 3561 return "previous", true 3562 case CaptureAction_FIRST: 3563 return "first", true 3564 case CaptureAction_LAST: 3565 return "last", true 3566 default: 3567 return "", false 3568 } 3569 } 3570 3571 type CaptureHandle struct { 3572 // Origin is "CaptureHandle.origin" 3573 // 3574 // Optional 3575 Origin js.String 3576 // Handle is "CaptureHandle.handle" 3577 // 3578 // Optional 3579 Handle js.String 3580 3581 FFI_USE bool 3582 } 3583 3584 // FromRef calls UpdateFrom and returns a CaptureHandle with all fields set. 3585 func (p CaptureHandle) FromRef(ref js.Ref) CaptureHandle { 3586 p.UpdateFrom(ref) 3587 return p 3588 } 3589 3590 // New creates a new CaptureHandle in the application heap. 3591 func (p CaptureHandle) New() js.Ref { 3592 return bindings.CaptureHandleJSLoad( 3593 js.Pointer(&p), js.True, 0, 3594 ) 3595 } 3596 3597 // UpdateFrom copies value of all fields of the heap object to p. 3598 func (p *CaptureHandle) UpdateFrom(ref js.Ref) { 3599 bindings.CaptureHandleJSStore( 3600 js.Pointer(p), ref, 3601 ) 3602 } 3603 3604 // Update writes all fields of the p to the heap object referenced by ref. 3605 func (p *CaptureHandle) Update(ref js.Ref) { 3606 bindings.CaptureHandleJSLoad( 3607 js.Pointer(p), js.False, ref, 3608 ) 3609 } 3610 3611 // FreeMembers frees fields with heap reference, if recursive is true 3612 // free all heap references reachable from p. 3613 func (p *CaptureHandle) FreeMembers(recursive bool) { 3614 js.Free( 3615 p.Origin.Ref(), 3616 p.Handle.Ref(), 3617 ) 3618 p.Origin = p.Origin.FromRef(js.Undefined) 3619 p.Handle = p.Handle.FromRef(js.Undefined) 3620 } 3621 3622 type MediaStreamTrackState uint32 3623 3624 const ( 3625 _ MediaStreamTrackState = iota 3626 3627 MediaStreamTrackState_LIVE 3628 MediaStreamTrackState_ENDED 3629 ) 3630 3631 func (MediaStreamTrackState) FromRef(str js.Ref) MediaStreamTrackState { 3632 return MediaStreamTrackState(bindings.ConstOfMediaStreamTrackState(str)) 3633 } 3634 3635 func (x MediaStreamTrackState) String() (string, bool) { 3636 switch x { 3637 case MediaStreamTrackState_LIVE: 3638 return "live", true 3639 case MediaStreamTrackState_ENDED: 3640 return "ended", true 3641 default: 3642 return "", false 3643 } 3644 }