MediaSource.hx 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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\MediaSource.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. The `MediaSource` interface of the Media Source Extensions API represents a source of media data for an `HTMLMediaElement` object. A `MediaSource` object can be attached to a `HTMLMediaElement` to be played in the user agent.
  26. Documentation [MediaSource](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource$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/MediaSource>
  28. **/
  29. @:native("MediaSource")
  30. extern class MediaSource extends EventTarget {
  31. static function isTypeSupported( type : String ) : Bool;
  32. /**
  33. Returns a `SourceBufferList` object containing the list of `SourceBuffer` objects associated with this `MediaSource`.
  34. **/
  35. var sourceBuffers(default,null) : SourceBufferList;
  36. /**
  37. Returns a `SourceBufferList` object containing a subset of the `SourceBuffer` objects contained within `MediaSource.sourceBuffers` — the list of objects providing the selected video track,  enabled audio tracks, and shown/hidden text tracks.
  38. **/
  39. var activeSourceBuffers(default,null) : SourceBufferList;
  40. /**
  41. Returns an enum representing the state of the current `MediaSource`, whether it is not currently attached to a media element (`closed`), attached and ready to receive `SourceBuffer` objects (`open`), or attached but the stream has been ended via `MediaSource.endOfStream()` (`ended`.)
  42. **/
  43. var readyState(default,null) : MediaSourceReadyState;
  44. /**
  45. Gets and sets the duration of the current media being presented.
  46. **/
  47. var duration : Float;
  48. /**
  49. The event handler for the `sourceopen` event.
  50. **/
  51. var onsourceopen : haxe.Constraints.Function;
  52. /**
  53. The event handler for the `sourceended` event.
  54. **/
  55. var onsourceended : haxe.Constraints.Function;
  56. var onsourceclosed : haxe.Constraints.Function;
  57. /** @throws DOMError */
  58. function new() : Void;
  59. /**
  60. Creates a new `SourceBuffer` of the given MIME type and adds it to the `MediaSource.sourceBuffers` list.
  61. @throws DOMError
  62. **/
  63. function addSourceBuffer( type : String ) : SourceBuffer;
  64. /**
  65. Removes the given `SourceBuffer` from the `MediaSource.sourceBuffers` list.
  66. @throws DOMError
  67. **/
  68. function removeSourceBuffer( sourceBuffer : SourceBuffer ) : Void;
  69. /**
  70. Signals the end of the stream.
  71. @throws DOMError
  72. **/
  73. function endOfStream( ?error : MediaSourceEndOfStreamError ) : Void;
  74. /**
  75. Sets the range that the user can seek to in the media element.
  76. @throws DOMError
  77. **/
  78. function setLiveSeekableRange( start : Float, end : Float ) : Void;
  79. /**
  80. Clears a seekable range privious set with a call to `setLiveSeekableRange()`.
  81. @throws DOMError
  82. **/
  83. function clearLiveSeekableRange() : Void;
  84. }