PeerConnection.hx 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (C)2005-2017 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\RTCPeerConnection.webidl. Do not edit!
  23. package js.html.rtc;
  24. /**
  25. The `RTCPeerConnection` interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.
  26. Documentation [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection>
  28. **/
  29. @:native("RTCPeerConnection")
  30. extern class PeerConnection extends js.html.EventTarget
  31. {
  32. /** @throws DOMError */
  33. static function generateCertificate( keygenAlgorithm : haxe.extern.EitherType<Dynamic,String> ) : Promise<Certificate>;
  34. var localDescription(default,null) : SessionDescription;
  35. var remoteDescription(default,null) : SessionDescription;
  36. var signalingState(default,null) : SignalingState;
  37. var canTrickleIceCandidates(default,null) : Bool;
  38. var iceGatheringState(default,null) : IceGatheringState;
  39. var iceConnectionState(default,null) : IceConnectionState;
  40. var peerIdentity(default,null) : Promise<IdentityAssertion>;
  41. var idpLoginUrl(default,null) : String;
  42. var onnegotiationneeded : haxe.Constraints.Function;
  43. var onicecandidate : haxe.Constraints.Function;
  44. var onsignalingstatechange : haxe.Constraints.Function;
  45. var onaddstream : haxe.Constraints.Function;
  46. var onaddtrack : haxe.Constraints.Function;
  47. var ontrack : haxe.Constraints.Function;
  48. var onremovestream : haxe.Constraints.Function;
  49. var oniceconnectionstatechange : haxe.Constraints.Function;
  50. var ondatachannel : haxe.Constraints.Function;
  51. /** @throws DOMError */
  52. function new( ?configuration : Configuration, ?constraints : Dynamic ) : Void;
  53. function setIdentityProvider( provider : String, ?protocol : String, ?username : String ) : Void;
  54. function getIdentityAssertion() : Promise<String>;
  55. @:overload( function( ?options : OfferOptions ) : Promise<SessionDescription> {} )
  56. function createOffer( successCallback : SessionDescription -> Void, failureCallback : js.html.DOMError -> Void, ?options : OfferOptions ) : Promise<Void>;
  57. @:overload( function( ?options : AnswerOptions ) : Promise<SessionDescription> {} )
  58. function createAnswer( successCallback : SessionDescription -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  59. @:overload( function( description : SessionDescription ) : Promise<Void> {} )
  60. function setLocalDescription( description : SessionDescription, successCallback : Void -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  61. @:overload( function( description : SessionDescription ) : Promise<Void> {} )
  62. function setRemoteDescription( description : SessionDescription, successCallback : Void -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  63. @:overload( function( candidate : IceCandidate ) : Promise<Void> {} )
  64. function addIceCandidate( candidate : IceCandidate, successCallback : Void -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  65. function getConfiguration() : Configuration;
  66. function getLocalStreams() : Array<js.html.MediaStream>;
  67. function getRemoteStreams() : Array<js.html.MediaStream>;
  68. function getStreamById( streamId : String ) : js.html.MediaStream;
  69. function addStream( stream : js.html.MediaStream ) : Void;
  70. function removeStream( stream : js.html.MediaStream ) : Void;
  71. function addTrack( track : js.html.MediaStreamTrack, stream : js.html.MediaStream, moreStreams : haxe.extern.Rest<js.html.MediaStream> ) : RtpSender;
  72. function removeTrack( sender : RtpSender ) : Void;
  73. function getSenders() : Array<RtpSender>;
  74. function getReceivers() : Array<RtpReceiver>;
  75. function close() : Void;
  76. @:overload( function( ?selector : js.html.MediaStreamTrack ) : Promise<StatsReport> {} )
  77. function getStats( selector : js.html.MediaStreamTrack, successCallback : StatsReport -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  78. function createDataChannel( label : String, ?dataChannelDict : DataChannelInit ) : Dynamic/*MISSING RTCDataChannel*/;
  79. }