Skip to content

Commit de23267

Browse files
committed
fix(MediaSourceDisplayArea): Adapt for wslink>=2
This fixes the error " n.arrayBuffer is not a function" when using the MediaSourceDisplayArea
1 parent 4c484cf commit de23267

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

vue-components/src/components/MediaSourceDisplayArea.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,17 @@ export default {
126126
};
127127
},
128128
mounted() {
129-
this.onChunkAvailable = ([{ name, meta, content }]) => {
129+
this.onChunkAvailable = async ([{ name, meta, content }]) => {
130130
if (!meta.type.includes('video/')) {
131131
this.hasContent = false;
132132
return;
133133
}
134134
if (this.name === name) {
135135
this.received += 1;
136-
content.arrayBuffer().then((v) => this.pushChunk(v, meta.type));
136+
const v = content.buffer
137+
? content
138+
: new Uint8Array(await content.arrayBuffer());
139+
this.pushChunk(v, meta.type);
137140
this.hasContent = true;
138141
}
139142
};

0 commit comments

Comments
 (0)