Using spaces is WAY better for your career.
This is because in JavaScript, there is a HEAVY perception bias against tab users. Most ES6 developers look down on anyone who uses tabs. This could easily mean the difference between getting a job offer and being rejected. It could mean tens of thousands of dollars of salary potential. https://medium.com/mintbean-io/tabs-or-spaces-for-practical-javascript-developers-the-answer-is-clear-f66c0458aa1e
This commit is contained in:
parent
cc8792da09
commit
7843f8b0e4
|
@ -1,5 +1,3 @@
|
||||||
{
|
{
|
||||||
"useTabs": true,
|
|
||||||
"tabWidth": 4,
|
|
||||||
"semi": false
|
"semi": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,11 +226,7 @@ declare module "mp4box" {
|
||||||
|
|
||||||
init(options?: FileOptions): ISOFile
|
init(options?: FileOptions): ISOFile
|
||||||
addTrack(options?: TrackOptions): number
|
addTrack(options?: TrackOptions): number
|
||||||
addSample(
|
addSample(track: number, data: ArrayBuffer, options?: SampleOptions): Sample
|
||||||
track: number,
|
|
||||||
data: ArrayBuffer,
|
|
||||||
options?: SampleOptions
|
|
||||||
): Sample
|
|
||||||
|
|
||||||
createSingleSampleMoof(sample: Sample): Box
|
createSingleSampleMoof(sample: Sample): Box
|
||||||
|
|
||||||
|
|
|
@ -91,11 +91,7 @@ export default class Decoder {
|
||||||
const avcc = sample.description.avcC
|
const avcc = sample.description.avcC
|
||||||
if (!avcc) throw new Error("TODO only h264 is supported")
|
if (!avcc) throw new Error("TODO only h264 is supported")
|
||||||
|
|
||||||
const description = new MP4.Stream(
|
const description = new MP4.Stream(new Uint8Array(avcc.size), 0, false)
|
||||||
new Uint8Array(avcc.size),
|
|
||||||
0,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
avcc.write(description)
|
avcc.write(description)
|
||||||
|
|
||||||
const videoDecoder = new VideoDecoder({
|
const videoDecoder = new VideoDecoder({
|
||||||
|
|
|
@ -3,10 +3,7 @@ export default class Reader {
|
||||||
reader: ReadableStream
|
reader: ReadableStream
|
||||||
buffer: Uint8Array
|
buffer: Uint8Array
|
||||||
|
|
||||||
constructor(
|
constructor(reader: ReadableStream, buffer: Uint8Array = new Uint8Array(0)) {
|
||||||
reader: ReadableStream,
|
|
||||||
buffer: Uint8Array = new Uint8Array(0)
|
|
||||||
) {
|
|
||||||
this.reader = reader
|
this.reader = reader
|
||||||
this.buffer = buffer
|
this.buffer = buffer
|
||||||
}
|
}
|
||||||
|
@ -41,9 +38,7 @@ export default class Reader {
|
||||||
if (this.buffer.byteLength == 0) {
|
if (this.buffer.byteLength == 0) {
|
||||||
this.buffer = buffer
|
this.buffer = buffer
|
||||||
} else {
|
} else {
|
||||||
const temp = new Uint8Array(
|
const temp = new Uint8Array(this.buffer.byteLength + buffer.byteLength)
|
||||||
this.buffer.byteLength + buffer.byteLength
|
|
||||||
)
|
|
||||||
temp.set(this.buffer)
|
temp.set(this.buffer)
|
||||||
temp.set(buffer, this.buffer.byteLength)
|
temp.set(buffer, this.buffer.byteLength)
|
||||||
this.buffer = temp
|
this.buffer = temp
|
||||||
|
@ -72,9 +67,7 @@ export default class Reader {
|
||||||
if (this.buffer.byteLength == 0) {
|
if (this.buffer.byteLength == 0) {
|
||||||
this.buffer = buffer
|
this.buffer = buffer
|
||||||
} else {
|
} else {
|
||||||
const temp = new Uint8Array(
|
const temp = new Uint8Array(this.buffer.byteLength + buffer.byteLength)
|
||||||
this.buffer.byteLength + buffer.byteLength
|
|
||||||
)
|
|
||||||
temp.set(this.buffer)
|
temp.set(this.buffer)
|
||||||
temp.set(buffer, this.buffer.byteLength)
|
temp.set(buffer, this.buffer.byteLength)
|
||||||
this.buffer = temp
|
this.buffer = temp
|
||||||
|
@ -110,9 +103,7 @@ export default class Reader {
|
||||||
if (this.buffer.byteLength == 0) {
|
if (this.buffer.byteLength == 0) {
|
||||||
this.buffer = buffer
|
this.buffer = buffer
|
||||||
} else {
|
} else {
|
||||||
const temp = new Uint8Array(
|
const temp = new Uint8Array(this.buffer.byteLength + buffer.byteLength)
|
||||||
this.buffer.byteLength + buffer.byteLength
|
|
||||||
)
|
|
||||||
temp.set(this.buffer)
|
temp.set(this.buffer)
|
||||||
temp.set(buffer, this.buffer.byteLength)
|
temp.set(buffer, this.buffer.byteLength)
|
||||||
this.buffer = temp
|
this.buffer = temp
|
||||||
|
|
|
@ -75,9 +75,7 @@ export default class Transport {
|
||||||
if (typ != "warp") throw "expected warp atom"
|
if (typ != "warp") throw "expected warp atom"
|
||||||
if (size < 8) throw "atom too small"
|
if (size < 8) throw "atom too small"
|
||||||
|
|
||||||
const payload = new TextDecoder("utf-8").decode(
|
const payload = new TextDecoder("utf-8").decode(await r.bytes(size - 8))
|
||||||
await r.bytes(size - 8)
|
|
||||||
)
|
|
||||||
const msg = JSON.parse(payload)
|
const msg = JSON.parse(payload)
|
||||||
|
|
||||||
if (msg.init) {
|
if (msg.init) {
|
||||||
|
|
Loading…
Reference in New Issue