MediaRecorder.hx 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright (C)2005-2018 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 using 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 function isTypeSupported( type : String ) : Bool;
  33. /**
  34. Returns the stream that was passed into the constructor when the `MediaRecorder` was created.
  35. **/
  36. var stream(default,null) : MediaStream;
  37. /**
  38. Returns the current state of the `MediaRecorder` object (`inactive`, `recording`, or `paused`.)
  39. **/
  40. var state(default,null) : RecordingState;
  41. /**
  42. Returns the MIME type that was selected as the recording container for the `MediaRecorder` object when it was created.
  43. **/
  44. var mimeType(default,null) : String;
  45. var ondataavailable : haxe.Constraints.Function;
  46. var onerror : haxe.Constraints.Function;
  47. var onstart : haxe.Constraints.Function;
  48. var onstop : haxe.Constraints.Function;
  49. var onwarning : haxe.Constraints.Function;
  50. /** @throws DOMError */
  51. @:overload( function( stream : MediaStream, ?options : MediaRecorderOptions ) : Void {} )
  52. function new( node : js.html.audio.AudioNode, ?output : Int = 0, ?options : MediaRecorderOptions ) : Void;
  53. /**
  54. 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.
  55. @throws DOMError
  56. **/
  57. function start( ?timeSlice : Int ) : Void;
  58. /**
  59. Stops recording, at which point a `dataavailable` event containing the final `Blob` of saved data is fired. No more recording occurs.
  60. @throws DOMError
  61. **/
  62. function stop() : Void;
  63. /**
  64. Pauses the recording of media.
  65. @throws DOMError
  66. **/
  67. function pause() : Void;
  68. /**
  69. Resumes recording of media after having been paused.
  70. @throws DOMError
  71. **/
  72. function resume() : Void;
  73. /**
  74. 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`.
  75. @throws DOMError
  76. **/
  77. function requestData() : Void;
  78. }