Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
"compilerOptions": {
"composite": true
},
"include": [
"."
]
}
"include": ["."]
}
14 changes: 7 additions & 7 deletions lib/contribute/broadcast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
const settings = media.getSettings()

if (media.kind === "audio") {
const audioContext = new AudioContext();
const audioContext = new AudioContext()
audioContext.createMediaStreamSource(new MediaStream([media]))
const sampleRate = audioContext.sampleRate
Object.assign(settings, {
sampleRate,
})
audioContext.close()

Check failure on line 55 in lib/contribute/broadcast.ts

View workflow job for this annotation

GitHub Actions / check

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}

console.log("track settings", settings, media, mediaTracks)
Expand Down Expand Up @@ -121,7 +121,7 @@
console.log("[Broadcast] #run loop started")
await this.connection.publish_namespace(this.namespace)

for (; ;) {
for (;;) {
const subscriber = await this.connection.subscribed()
if (!subscriber) break

Expand Down Expand Up @@ -164,7 +164,7 @@
const bytes = Catalog.encode(this.catalog)

await subscriber.ack()
await sleep(500);
await sleep(500)

const stream = await subscriber.subgroup({ group: 0, subgroup: 0 })
await stream.write({ object_id: 0, object_payload: bytes })
Expand All @@ -176,7 +176,7 @@
if (!track) throw new Error(`no track with name ${subscriber.track}`)

await subscriber.ack()
await sleep(500);
await sleep(500)

const init = await track.init()

Expand All @@ -193,11 +193,11 @@
await subscriber.ack()

// NOTE(itzmanish): hack to make sure subscribe ok reaches before the segement object
await sleep(500);
await sleep(500)

const segments = track.segments().getReader()

for (; ;) {
for (;;) {
const { value: segment, done } = await segments.read()
if (done) break

Expand All @@ -221,7 +221,7 @@

// Pipe the segment to the stream.
const chunks = segment.chunks().getReader()
for (; ;) {
for (;;) {
const { value, done } = await chunks.read()
if (done) break

Expand Down
2 changes: 1 addition & 1 deletion lib/contribute/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class Container {

// Moof and mdat atoms are written in pairs.
// TODO remove the moof/mdat from the Box to reclaim memory once everything works
for (; ;) {
for (;;) {
const moof = this.#mp4.moofs.shift()
const mdat = this.#mp4.mdats.shift()

Expand Down
2 changes: 1 addition & 1 deletion lib/contribute/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class Track {

return new ReadableStream({
pull: async (controller) => {
for (; ;) {
for (;;) {
let index = pos - this.#offset
if (index < 0) index = 0

Expand Down
11 changes: 3 additions & 8 deletions lib/contribute/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{
"extends": "../tsconfig.json",
"include": [
"."
],
"include": ["."],
"compilerOptions": {
"types": [
"dom-mediacapture-transform",
"dom-webcodecs"
]
"types": ["dom-mediacapture-transform", "dom-webcodecs"]
},
"references": [
{
Expand All @@ -20,4 +15,4 @@
"path": "../media"
}
]
}
}
10 changes: 3 additions & 7 deletions lib/media/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": "../tsconfig.json",
"include": [
"."
],
"include": ["."],
"compilerOptions": {
"types": [
"mp4box"
]
"types": ["mp4box"]
},
"references": [
{
Expand All @@ -16,4 +12,4 @@
"path": "../common"
}
]
}
}
2 changes: 1 addition & 1 deletion lib/moq-publisher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
this.handleClick = this.handleClick.bind(this)

// Listeners
navigator.mediaDevices.addEventListener("devicechange", this.handleDeviceChange)

Check failure on line 60 in lib/moq-publisher/index.ts

View workflow job for this annotation

GitHub Actions / check

Promise returned in function argument where a void return was expected
this.cameraSelect.addEventListener("change", () => this.startPreview())
this.microphoneSelect.addEventListener("change", () => this.startPreview())
this.connectButton.addEventListener("click", this.handleClick)
Expand Down Expand Up @@ -194,4 +194,4 @@
}

customElements.define("publisher-moq", PublisherMoq)
export default PublisherMoq
export default PublisherMoq
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@
"type": "git",
"url": "https://github.com/englishm/moq-js"
}
}
}
2 changes: 1 addition & 1 deletion lib/playback/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default class Player extends EventTarget {

try {
console.log("starting segment data loop")
for (; ;) {
for (;;) {
console.log("waiting for segment data")
const segment = await Promise.race([sub.data(), this.#running])
if (!segment) continue
Expand Down
2 changes: 1 addition & 1 deletion lib/playback/worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Worker {
segments.releaseLock()

// Read each chunk, decoding the MP4 frames and adding them to the queue.
for (; ;) {
for (;;) {
const chunk = await reader.read()
if (!chunk) {
break
Expand Down
2 changes: 1 addition & 1 deletion lib/playback/worker/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Renderer {

async #run() {
const reader = this.#timeline.frames.pipeThrough(this.#queue).getReader()
for (; ;) {
for (;;) {
const { value: frame, done } = await reader.read()
if (this.#paused) continue
if (done) break
Expand Down
2 changes: 1 addition & 1 deletion lib/publish/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export class PublisherApi {
await this.connection.closed()
}
}
}
}
Loading
Loading