MediaRecorder.hx 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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\MediaRecorder.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. The `MediaRecorder` interface of the MediaStream Recording API provides functionality to easily record media. It is created by the invocation of the `MediaRecorder()` constructor.
  26. Documentation [MediaRecorder](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder$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/MediaRecorder>
  28. **/
  29. @:native("MediaRecorder")
  30. extern class MediaRecorder extends EventTarget
  31. {
  32. static
  33. /**
  34.  Returns a `Boolean` value indicating if the given MIME type is supported by the current user agent . 
  35. **/
  36. function isTypeSupported( type : String ) : Bool;
  37. /**
  38. Returns the stream that was passed into the constructor when the `MediaRecorder` was created.
  39. **/
  40. var stream(default,null) : MediaStream;
  41. /**
  42. Returns the current state of the `MediaRecorder` object (`inactive`, `recording`, or `paused`.)
  43. **/
  44. var state(default,null) : RecordingState;
  45. /**
  46. Returns the MIME type that was selected as the recording container for the `MediaRecorder` object when it was created.
  47. **/
  48. var mimeType(default,null) : String;
  49. var ondataavailable : haxe.Constraints.Function;
  50. var onerror : haxe.Constraints.Function;
  51. var onstart : haxe.Constraints.Function;
  52. var onstop : haxe.Constraints.Function;
  53. var onwarning : haxe.Constraints.Function;
  54. /** @throws DOMError */
  55. @:overload( function( stream : MediaStream, ?options : MediaRecorderOptions ) : Void {} )
  56. function new( node : js.html.audio.AudioNode, ?output : Int = 0, ?options : MediaRecorderOptions ) : Void;
  57. /** @throws DOMError */
  58. /**
  59. Begins recording media; this method can optionally be passed a `timeslice` argument with a value in milliseconds. If this is specified, the media will be captured in separate chunks of that duration, rather than the default behavior of recording the media in a single large chunk.
  60. **/
  61. function start( ?timeSlice : Int ) : Void;
  62. /** @throws DOMError */
  63. /**
  64. Stops recording, at which point a `dataavailable` event containing the final `Blob` of saved data is fired. No more recording occurs.
  65. **/
  66. function stop() : Void;
  67. /** @throws DOMError */
  68. /**
  69. Pauses the recording of media.
  70. **/
  71. function pause() : Void;
  72. /** @throws DOMError */
  73. /**
  74. Resumes recording of media after having been paused.
  75. **/
  76. function resume() : Void;
  77. /** @throws DOMError */
  78. /**
  79. Requests a `Blob` containing the saved data received thus far (or since the last time `requestData()` was called. After calling this method, recording continues, but in a new `Blob`.
  80. **/
  81. function requestData() : Void;
  82. }