Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit f694e27

Browse files
authored
Check availability of SendStream and BidirectionalStream. (#455)
These two objects are only defined in limited environments.
1 parent 0635a1e commit f694e27

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sdk/base/stream.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ export class Stream extends EventDispatcher {
5656
constructor(stream, sourceInfo, attributes) {
5757
super();
5858
if ((stream && !(stream instanceof MediaStream) &&
59-
!(stream instanceof SendStream) &&
60-
!(stream instanceof BidirectionalStream)) ||
59+
!(typeof SendStream === 'function' && stream instanceof SendStream) &&
60+
!(typeof BidirectionalStream === 'function' &&
61+
stream instanceof BidirectionalStream)) ||
6162
(typeof sourceInfo !== 'object')) {
6263
throw new TypeError('Invalid stream or sourceInfo.');
6364
}

0 commit comments

Comments
 (0)