-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathoptions.ts
More file actions
196 lines (165 loc) 路 7.25 KB
/
Copy pathoptions.ts
File metadata and controls
196 lines (165 loc) 路 7.25 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import { VideomailClientOptions } from "./types/options";
import isProductionMode from "./util/isProductionMode";
const PRODUCTION = isProductionMode();
const options: VideomailClientOptions = {
logger: console, // define logging instance. defaults to console.
logStackSize: 30, // limits the stack size of log outputs to collect
verbose: !PRODUCTION, // set true to log more info
apiUrl: "https://videomail.io/api", // leave as it, permanent API url to post videos
socketUrl: "wss://videomail.io/ws", // leave as it, permanent websocket url to send frames
whitelistKey: "videomail-client-demo", // Required for API, use https://videomail.io/whitelist
enablePause: true, // enable pause/resume button
enableAutoPause: true, // automatically pauses when window becomes inactive
enableSpace: true, // hitting space can pause recording
submitWithVideomail: false, // when enabled, all videomail metadata is submitted
// under the `videomail` key inside the form data body.
disableSubmit: false, // set this to true if you do not want to submit videos,
// but just want to record and replay these temporarily
enableAutoValidation: true, // automatically validates all form inputs if any exist and
enableAutoUnload: true, // automatically unloads VC when navigating away
/*
* does not /enable disable submit button after recording
* when something else seems invalid.
*/
enableAutoSubmission: true, // automatically submits the form where the videomail-client
/*
* appears upon press of submit button. disable it when
* you want a framework to deal with the form submission itself.
*/
enctype: "application/json", // enctype for the form submission. currently implemented are:
// 'application/json' and 'application/x-www-form-urlencoded'
// default CSS selectors you can alter, see examples
selectors: {
containerId: undefined,
containerClass: "videomail",
replayClass: "replay",
userMediaClass: "userMedia",
visualsClass: "visuals",
buttonClass: undefined, // can also be used as a default class for all buttons
buttonsClass: "buttons",
recordButtonClass: "record",
pauseButtonClass: "pause",
resumeButtonClass: "resume",
previewButtonClass: "preview",
recordAgainButtonClass: "recordAgain",
submitButtonClass: "submit",
subjectInputName: "subject", // the form input name for subject
fromInputName: "from", // the form input name for the from email
toInputName: "to", // the form input name for the to email
ccInputName: "cc", // the form input name for the cc email
bccInputName: "bcc", // the form input name for the bcc email
bodyInputName: "body", // the form input name for the message (body)
sendCopyInputName: "sendCopy", // the form checkbox name for sending myself a copy
keyInputName: "videomail_key",
parentKeyInputName: "videomail_parent_key",
formId: undefined, // automatically detects form if any
submitButtonId: undefined, // semi-automatically detects submit button in the form
// but if that does not work, try using the
submitButtonSelector: undefined, // submitButtonSelector
},
audio: {
enabled: false, // set to true for experimental audio recording
switch: false, // enables a switcher for audio recording (on/off)
// must be between 0 .. 1 but 0.20 is recommended to avoid distorting at the higher volume peaks
volume: 0.2,
/*
* Decides how often the audio is being sampled,
*
* It can be 'auto' or an integer being a power of two like 512 or 2048
* the higher the less traffic, but harder to adjust with rubberband
* to match with the video length on server side during encoding
*/
bufferSize: "auto",
},
video: {
fps: 15, // depends on your connection
limitSeconds: 30, // recording automatically stops after that limit
countdown: 3, // set it to 0 or false to disable it
/*
* It is recommended to set one dimension only and leave the other one to auto
* because each webcam has a different aspect ratio
*/
width: undefined, // or use an integer for exact pixels
height: undefined, // or use an integer for exact pixels
facingMode: "user", // can be 'user', 'environment', 'left' or 'right'. useful for mobiles.
facingModeButton: false,
stretch: false, // Set to true if you want the video to take the full width of the parent container
// If you define one, all video related width will be set to 100% below this breakpoint
mobileBreakPoint: undefined,
// Default is undefined, because ...
// ... accessibility. Let the user decide when to play.
autoPlay: undefined,
},
image: {
quality: 0.42,
types: ["webp", "jpeg"], // recommended settings to make most of all browsers
},
// alter these text for internationalization
text: {
pausedHeader: "Paused",
pausedHint: undefined,
sending: "Teleporting",
encoding: "Encoding",
limitReached: "Limit reached",
audioOff: "Audio off",
audioOn: "Audio on",
buttons: {
record: "Record video",
recordAgain: "Record again",
resume: "Resume",
pause: "Pause",
preview: "Preview",
},
},
notifier: {
entertain: false, // when true, user is entertained while waiting, see examples
entertainClass: "bg",
entertainLimit: 6,
entertainInterval: 9000,
},
timeouts: {
userMedia: 20e3, // in milliseconds, increase if you want user give more time to enable webcam
connection: 1e4, // in seconds, increase if api is slow
pingInterval: 30e3, // in milliseconds, keeps web stream (connection) alive when pausing
},
loadUserMediaOnRecord: false, // when true, user media is loaded only when record button is pressed
callbacks: {
/*
* A custom callback to tweak form data before posting to server
* this is for advanced use only and shouldn't be used if possible
*/
adjustFormDataBeforePosting: undefined,
/*
Another custom callback to tweak a single form value before populating the form.
*/
adjustFormValueBeforePopulating: undefined,
},
defaults: {
from: undefined, // define default FROM email address
to: undefined, // define default TO email address
cc: undefined, // define default CC email address
bcc: undefined, // define default BCC email address
subject: undefined, // define default subject line
body: undefined, // define default body content
},
// show errors inside the container?
displayErrors: true,
// true = all form inputs get disabled and disappear when browser can't record
adjustFormOnBrowserError: true,
// when true, any errors will be sent to the videomail server for analysis
reportErrors: true,
// This is because we need to set this to false by default for our WordPress plugin unfortunately.
// Because WordPress plugins do overlap with each other.
//
// We will keep the default to `true` but offer an option to correct it on WP side.
disableFormWhenSubmitting: true,
// just for testing purposes to simulate browser agent handling
fakeUaString: undefined,
// Experimental, needs more work:
// But for better mobile support, this shall be set to true for now.
recalculateDimensionsOnWindowResize: false,
versions: {
videomailNinjaFormPlugin: undefined,
},
};
export default options;