/
SourceBuffer.cljs
406 lines (283 loc) · 12.2 KB
/
SourceBuffer.cljs
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
(ns web.audio.SourceBuffer
"The SourceBuffer interface represents a chunk of media to be
into an `web.media.HTMLMediaElement` and played, via a `web.audio.MediaSource`
This can be made up of one or several media segments."
(:refer-clojure :exclude [remove]))
(defn abort
"Method.
The abort() method of the `web.audio.SourceBuffer` interface
the current segment and resets the segment parser.
`sourceBuffer.abort();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/abort`"
[this ]
(-> this (.abort)))
(defn append-buffer
"Method.
The appendBuffer() method of the `web.audio.SourceBuffer` interface
media segment data from an `js.ArrayBuffer` or ArrayBufferView
to the SourceBuffer.
`sourceBuffer.appendBuffer(source);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer`"
[this source]
(-> this (.appendBuffer source)))
(defn append-buffer-async
"Method.
The `web.audio.SourceBuffer` method appendBufferAsync() begins
process of asynchronously appending media segment data from an
or `web.typed.ArrayBufferView` object to the SourceBuffer.
`appendPromise = sourceBuffer.appendBufferAsync(source);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBufferAsync`"
[this source]
(-> this (.appendBufferAsync source)))
(defn append-stream
"Method.
The appendStream() method of the `web.audio.SourceBuffer` interface
media segment data from a ReadableStream object to the SourceBuffer.
`sourceBuffer.appendStream(stream, maxSize);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendStream`"
[this stream max-size]
(-> this (.appendStream stream max-size)))
(defn change-type
"Method.
The `web.audio.SourceBuffer` method changeType() sets the MIME
that future calls to `appendBuffer()` should expect the new media
to conform to.
`sourceBuffer.changeType(type);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/changeType`"
[this type]
(-> this (.changeType type)))
(defn remove
"Method.
The remove() method of the `web.audio.SourceBuffer` interface
media segments within a specific time range from the SourceBuffer.
method can only be called when `SourceBuffer.updating` equals
If SourceBuffer.updating is not equal to false, call `SourceBuffer.abort()`.
`sourceBuffer.remove(start, end);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/remove`"
[this start end]
(-> this (.remove start end)))
(defn remove-async
"Method.
The removeAsync() method of the `web.audio.SourceBuffer` interface
the process of asynchronously removing from the SourceBuffer
segments found within a specific time range.
`removePromise = sourceBuffer.removeAsync(start, end);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/removeAsync`"
[this start end]
(-> this (.removeAsync start end)))
(defn append-window-end
"Property.
The appendWindowEnd property of the `web.audio.SourceBuffer`
controls the timestamp for the end of the append window, a timestamp
that can be used to filter what media data is appended to the
Coded media frames with timestamps wthin this range will be appended,
those outside the range will be filtered out.
`var myAppendWindowEnd = sourceBuffer.appendWindowEnd;
sourceBuffer.appendWindowEnd = 120.0;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendWindowEnd`"
[this]
(-> this (.appendWindowEnd)))
(defn set-append-window-end!
"Property.
The appendWindowEnd property of the `web.audio.SourceBuffer`
controls the timestamp for the end of the append window, a timestamp
that can be used to filter what media data is appended to the
Coded media frames with timestamps wthin this range will be appended,
those outside the range will be filtered out.
`var myAppendWindowEnd = sourceBuffer.appendWindowEnd;
sourceBuffer.appendWindowEnd = 120.0;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendWindowEnd`"
[this val]
(aset this "appendWindowEnd" val))
(defn onabort
"Property.
Fired whenever SourceBuffer.appendBuffer() or SourceBuffer.appendStream()
ended by a call to SourceBuffer.abort(). SourceBuffer.updating
from true to false."
[this]
(-> this (.onabort)))
(defn set-onabort!
"Property.
Fired whenever SourceBuffer.appendBuffer() or SourceBuffer.appendStream()
ended by a call to SourceBuffer.abort(). SourceBuffer.updating
from true to false."
[this val]
(aset this "onabort" val))
(defn append-window-start
"Property.
The appendWindowStart property of the `web.audio.SourceBuffer`
controls the timestamp for the start of the append window, a
range that can be used to filter what media data is appended
the SourceBuffer. Coded media frames with timestamps wthin this
will be appended, whereas those outside the range will be filtered
`var myAppendWindowStart = sourceBuffer.appendWindowStart;
sourceBuffer.appendWindowStart = 2.0;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendWindowStart`"
[this]
(-> this (.appendWindowStart)))
(defn set-append-window-start!
"Property.
The appendWindowStart property of the `web.audio.SourceBuffer`
controls the timestamp for the start of the append window, a
range that can be used to filter what media data is appended
the SourceBuffer. Coded media frames with timestamps wthin this
will be appended, whereas those outside the range will be filtered
`var myAppendWindowStart = sourceBuffer.appendWindowStart;
sourceBuffer.appendWindowStart = 2.0;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendWindowStart`"
[this val]
(aset this "appendWindowStart" val))
(defn audio-tracks
"Property.
The audioTracks read-only property of the `web.audio.SourceBuffer`
returns a list of the audio tracks currently contained inside
SourceBuffer.
`var myAudioTracks = sourceBuffer.audioTracks;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/audioTracks`"
[this]
(-> this (.audioTracks)))
(defn set-audio-tracks!
"Property.
The audioTracks read-only property of the `web.audio.SourceBuffer`
returns a list of the audio tracks currently contained inside
SourceBuffer.
`var myAudioTracks = sourceBuffer.audioTracks;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/audioTracks`"
[this val]
(aset this "audioTracks" val))
(defn buffered
"Property.
The buffered read-only property of the `web.audio.SourceBuffer`
returns the time ranges that are currently buffered in the SourceBuffer
a normalized `web.media.TimeRanges` object.
`var myBufferedRange = sourceBuffer.buffered;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/buffered`"
[this]
(-> this (.buffered)))
(defn set-buffered!
"Property.
The buffered read-only property of the `web.audio.SourceBuffer`
returns the time ranges that are currently buffered in the SourceBuffer
a normalized `web.media.TimeRanges` object.
`var myBufferedRange = sourceBuffer.buffered;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/buffered`"
[this val]
(aset this "buffered" val))
(defn mode
"Property.
The mode property of the `web.audio.SourceBuffer` interface controls
media segments can be appended to the SourceBuffer in any order,
in a strict sequence.
`var myMode = sourceBuffer.mode;
sourceBuffer.mode = 'sequence';`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/mode`"
[this]
(-> this (.mode)))
(defn set-mode!
"Property.
The mode property of the `web.audio.SourceBuffer` interface controls
media segments can be appended to the SourceBuffer in any order,
in a strict sequence.
`var myMode = sourceBuffer.mode;
sourceBuffer.mode = 'sequence';`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/mode`"
[this val]
(aset this "mode" val))
(defn text-tracks
"Property.
The textTracks read-only property of the `web.audio.SourceBuffer`
returns a list of the text tracks currently contained inside
SourceBuffer.
`var myTextTracks = sourceBuffer.textTracks;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/textTracks`"
[this]
(-> this (.textTracks)))
(defn set-text-tracks!
"Property.
The textTracks read-only property of the `web.audio.SourceBuffer`
returns a list of the text tracks currently contained inside
SourceBuffer.
`var myTextTracks = sourceBuffer.textTracks;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/textTracks`"
[this val]
(aset this "textTracks" val))
(defn timestamp-offset
"Property.
The timestampOffset property of the `web.audio.SourceBuffer`
controls the offset applied to timestamps inside media segments
are appended to the SourceBuffer.
`var myOffset = sourceBuffer.timestampOffset;
sourceBuffer.timestampOffset = 2.5;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/timestampOffset`"
[this]
(-> this (.timestampOffset)))
(defn set-timestamp-offset!
"Property.
The timestampOffset property of the `web.audio.SourceBuffer`
controls the offset applied to timestamps inside media segments
are appended to the SourceBuffer.
`var myOffset = sourceBuffer.timestampOffset;
sourceBuffer.timestampOffset = 2.5;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/timestampOffset`"
[this val]
(aset this "timestampOffset" val))
(defn track-defaults
"Property.
The trackDefaults property of the `web.audio.SourceBuffer` interface
the default values to use if kind, label, and/or language information
not available in the initialization segment of the media to be
to the SourceBuffer.
`var myTrackDefaults = sourceBuffer.trackDefaults;
sourceBuffer.trackDefaults = myTrackDefaultList;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/trackDefaults`"
[this]
(-> this (.trackDefaults)))
(defn set-track-defaults!
"Property.
The trackDefaults property of the `web.audio.SourceBuffer` interface
the default values to use if kind, label, and/or language information
not available in the initialization segment of the media to be
to the SourceBuffer.
`var myTrackDefaults = sourceBuffer.trackDefaults;
sourceBuffer.trackDefaults = myTrackDefaultList;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/trackDefaults`"
[this val]
(aset this "trackDefaults" val))
(defn updating
"Property.
The updating read-only property of the `web.audio.SourceBuffer`
indicates whether the SourceBuffer is currently being updated
i.e. whether an `SourceBuffer.appendBuffer()`, `SourceBuffer.appendStream()`,
`SourceBuffer.remove()` operation is currently in progress.
`var isUpdating = sourceBuffer.updating;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/updating`"
[this]
(-> this (.updating)))
(defn set-updating!
"Property.
The updating read-only property of the `web.audio.SourceBuffer`
indicates whether the SourceBuffer is currently being updated
i.e. whether an `SourceBuffer.appendBuffer()`, `SourceBuffer.appendStream()`,
`SourceBuffer.remove()` operation is currently in progress.
`var isUpdating = sourceBuffer.updating;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/updating`"
[this val]
(aset this "updating" val))
(defn video-tracks
"Property.
The videoTracks read-only property of the `web.audio.SourceBuffer`
returns a list of the video tracks currently contained inside
SourceBuffer.
`var myVideoTracks = sourceBuffer.videoTracks;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/videoTracks`"
[this]
(-> this (.videoTracks)))
(defn set-video-tracks!
"Property.
The videoTracks read-only property of the `web.audio.SourceBuffer`
returns a list of the video tracks currently contained inside
SourceBuffer.
`var myVideoTracks = sourceBuffer.videoTracks;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/videoTracks`"
[this val]
(aset this "videoTracks" val))