Skip to content

Commit

Permalink
Move tests using legacy MediaStreamTrackGenerator to a legacy folder
Browse files Browse the repository at this point in the history
  • Loading branch information
youennf committed Jan 29, 2024
1 parent e219351 commit ba45f90
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
onmessage = async msg => {
const reader = msg.data.readable.getReader();
let readResult = await reader.read();
postMessage(readResult.value);
readResult.value.close();
// Continue reading until the stream is done due to a track.stop()
while (true) {
readResult = await reader.read();
if (readResult.done) {
break;
} else {
readResult.value.close();
}
}
await reader.closed;
postMessage('closed');
}

0 comments on commit ba45f90

Please sign in to comment.