-
Notifications
You must be signed in to change notification settings - Fork 37
/
Browser.MediaRecorder.fs
65 lines (50 loc) · 1.95 KB
/
Browser.MediaRecorder.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
namespace Browser.Types
open Fable.Core
open Browser.Types
[<StringEnum>]
type MediaRecorderState =
| Inactive
| Recording
| Paused
type DOMHighResTimeStamp = System.Double
type [<AllowNullLiteral; Global>] BlobEvent =
inherit Event
abstract data: Blob
abstract timecode: DOMHighResTimeStamp
type [<AllowNullLiteral>] BlobEventType =
[<Emit("new $0($1...)")>] abstract Create: data: Blob * ?timecode: DOMHighResTimeStamp -> BlobEvent
type [<AllowNullLiteral>] MediaRecorderErrorEvent =
inherit Event
abstract error: DOMException
type [<Global>] MediaRecorder =
abstract mimeType: string
abstract state: MediaRecorderState
abstract stream: MediaStream
abstract videoBitsPerSecond: uint32
abstract audioBitsPerSecond: uint32
abstract pause: unit -> unit
abstract requestData: unit -> unit
abstract resume: unit -> unit
abstract start: ?timeslice: float -> unit
abstract stop: unit -> unit
abstract isTypeSupported: string -> bool
abstract ondataavailable: (BlobEvent -> unit) with get, set
abstract onerror: (MediaRecorderErrorEvent -> unit) with get, set
abstract onpause: (Event -> unit) with get, set
abstract onresume: (Event -> unit) with get, set
abstract onstart: (Event -> unit) with get, set
abstract onstop: (Event -> unit) with get, set
type MediaRecorderOptions =
abstract mimeType: string with get, set
abstract audioBitsPerSecond: uint32 with get, set
abstract videoBitsPerSecond: uint32 with get, set
abstract bitsPerSecond: uint32 with get, set
type MediaRecorderType =
[<Emit("new $0($1...)")>] abstract Create: stream: MediaStream * ?options: MediaRecorderOptions -> MediaRecorder
abstract isTypeSupported: mimeType: string -> bool
namespace Browser
open Fable.Core
open Browser.Types
[<AutoOpen>]
module MediaRecorder =
let [<Global>] MediaRecorder: MediaRecorderType = jsNative