MediaStream.hx 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (C)2005-2019 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\MediaStream.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. The `MediaStream` interface represents a stream of media content. A stream consists of several tracks such as video or audio tracks. Each track is specified as an instance of `MediaStreamTrack`.
  26. Documentation [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream$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/MediaStream>
  28. **/
  29. @:native("MediaStream")
  30. extern class MediaStream extends EventTarget {
  31. /**
  32. A `DOMString` containing 36 characters denoting a universally unique identifier (UUID) for the object.
  33. **/
  34. var id(default,null) : String;
  35. /**
  36. A Boolean value that returns `true` if the `MediaStream` is active, or `false` otherwise.
  37. **/
  38. var active(default,null) : Bool;
  39. /**
  40. An `EventHandler` containing the action to perform when an `addtrack` event is fired when a new `MediaStreamTrack` object is added.
  41. **/
  42. var onaddtrack : haxe.Constraints.Function;
  43. /**
  44. An `EventHandler` containing the action to perform when a `removetrack` event is fired when a  `MediaStreamTrack` object is removed from it.
  45. **/
  46. var onremovetrack : haxe.Constraints.Function;
  47. var currentTime(default,null) : Float;
  48. /** @throws DOMError */
  49. @:overload( function() : Void {} )
  50. @:overload( function( stream : MediaStream ) : Void {} )
  51. function new( tracks : Array<MediaStreamTrack> ) : Void;
  52. /**
  53. Returns a list of the `MediaStreamTrack` objects stored in the MediaStream` object that have their kind` attribute set to "audio"`. The order is not defined, and may not only vary from one browser to another, but also from one call to another.
  54. **/
  55. function getAudioTracks() : Array<AudioStreamTrack>;
  56. /**
  57. Returns a list of the `MediaStreamTrack` objects stored in the `MediaStream` object that have their `kind` attribute set to `"video"`. The order is not defined, and may not only vary from one browser to another, but also from one call to another.
  58. **/
  59. function getVideoTracks() : Array<VideoStreamTrack>;
  60. /**
  61. Returns a list of all `MediaStreamTrack` objects stored in the `MediaStream` object, regardless of the value of the `kind` attribute. The order is not defined, and may not only vary from one browser to another, but also from one call to another.
  62. **/
  63. function getTracks() : Array<MediaStreamTrack>;
  64. /**
  65. Returns the track whose ID corresponds to the one given in parameters, trackid`. If no parameter is given, or if no track with that ID does exist, it returns null`. If several tracks have the same ID, it returns the first one.
  66. **/
  67. function getTrackById( trackId : String ) : MediaStreamTrack;
  68. /**
  69. Stores a copy of the `MediaStreamTrack` given as argument. If the track has already been added to the `MediaStream` object, nothing happens.
  70. **/
  71. function addTrack( track : MediaStreamTrack ) : Void;
  72. /**
  73. Removes the `MediaStreamTrack` given as argument. If the track is not part of the MediaStream` object, nothing happens.
  74. **/
  75. function removeTrack( track : MediaStreamTrack ) : Void;
  76. /**
  77. Returns a clone of the `MediaStream` object. The clone will, however, have a unique value for `MediaStream.id`.
  78. **/
  79. function clone() : MediaStream;
  80. }