MediaStream.hx 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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\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. /**
  33. A `DOMString` containing 36 characters denoting a universally unique identifier (UUID) for the object.
  34. **/
  35. var id(default,null) : String;
  36. var currentTime(default,null) : Float;
  37. /** @throws DOMError */
  38. @:overload( function() : Void {} )
  39. @:overload( function( stream : MediaStream ) : Void {} )
  40. function new( tracks : Array<MediaStreamTrack> ) : Void;
  41. function getAudioTracks() : Array<AudioStreamTrack>;
  42. /**
  43. 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.
  44. **/
  45. function getVideoTracks() : Array<VideoStreamTrack>;
  46. /**
  47. 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.
  48. **/
  49. function getTracks() : Array<MediaStreamTrack>;
  50. /**
  51. Stores a copy of the `MediaStreamTrack` given as argument. If the track has already been added to the `MediaStream` object, nothing happens.
  52. **/
  53. function addTrack( track : MediaStreamTrack ) : Void;
  54. /**
  55. Removes the `MediaStreamTrack` given as argument. If the track is not part of the MediaStream` object, nothing happens.
  56. **/
  57. function removeTrack( track : MediaStreamTrack ) : Void;
  58. }