PeerConnection.hx 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (C)2005-2016 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 line 105:0. Do not edit!
  23. package js.html.rtc;
  24. @:native("RTCPeerConnection")
  25. extern class PeerConnection extends js.html.EventTarget
  26. {
  27. /** @throws DOMError */
  28. static function generateCertificate( keygenAlgorithm : haxe.extern.EitherType<Dynamic,String> ) : Promise<Certificate>;
  29. var localDescription(default,null) : SessionDescription;
  30. var remoteDescription(default,null) : SessionDescription;
  31. var signalingState(default,null) : SignalingState;
  32. var canTrickleIceCandidates(default,null) : Bool;
  33. var iceGatheringState(default,null) : IceGatheringState;
  34. var iceConnectionState(default,null) : IceConnectionState;
  35. var peerIdentity(default,null) : Promise<IdentityAssertion>;
  36. var idpLoginUrl(default,null) : String;
  37. var onnegotiationneeded : haxe.Constraints.Function;
  38. var onicecandidate : haxe.Constraints.Function;
  39. var onsignalingstatechange : haxe.Constraints.Function;
  40. var onaddstream : haxe.Constraints.Function;
  41. var onaddtrack : haxe.Constraints.Function;
  42. var ontrack : haxe.Constraints.Function;
  43. var onremovestream : haxe.Constraints.Function;
  44. var oniceconnectionstatechange : haxe.Constraints.Function;
  45. var ondatachannel : haxe.Constraints.Function;
  46. /** @throws DOMError */
  47. function new( ?configuration : Configuration, ?constraints : Dynamic ) : Void;
  48. function setIdentityProvider( provider : String, ?protocol : String, ?username : String ) : Void;
  49. function getIdentityAssertion() : Promise<String>;
  50. @:overload( function( ?options : OfferOptions ) : Promise<SessionDescription> {} )
  51. function createOffer( successCallback : SessionDescription -> Void, failureCallback : js.html.DOMError -> Void, ?options : OfferOptions ) : Promise<Void>;
  52. @:overload( function( ?options : AnswerOptions ) : Promise<SessionDescription> {} )
  53. function createAnswer( successCallback : SessionDescription -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  54. @:overload( function( description : SessionDescription ) : Promise<Void> {} )
  55. function setLocalDescription( description : SessionDescription, successCallback : Void -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  56. @:overload( function( description : SessionDescription ) : Promise<Void> {} )
  57. function setRemoteDescription( description : SessionDescription, successCallback : Void -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  58. @:overload( function( candidate : IceCandidate ) : Promise<Void> {} )
  59. function addIceCandidate( candidate : IceCandidate, successCallback : Void -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  60. function getConfiguration() : Configuration;
  61. function getLocalStreams() : Array<js.html.MediaStream>;
  62. function getRemoteStreams() : Array<js.html.MediaStream>;
  63. function getStreamById( streamId : String ) : js.html.MediaStream;
  64. function addStream( stream : js.html.MediaStream ) : Void;
  65. function removeStream( stream : js.html.MediaStream ) : Void;
  66. function addTrack( track : js.html.MediaStreamTrack, stream : js.html.MediaStream, moreStreams : haxe.extern.Rest<js.html.MediaStream> ) : RtpSender;
  67. function removeTrack( sender : RtpSender ) : Void;
  68. function getSenders() : Array<RtpSender>;
  69. function getReceivers() : Array<RtpReceiver>;
  70. function close() : Void;
  71. @:overload( function( ?selector : js.html.MediaStreamTrack ) : Promise<StatsReport> {} )
  72. function getStats( selector : js.html.MediaStreamTrack, successCallback : StatsReport -> Void, failureCallback : js.html.DOMError -> Void ) : Promise<Void>;
  73. function createDataChannel( label : String, ?dataChannelDict : DataChannelInit ) : Dynamic/*MISSING RTCDataChannel*/;
  74. }