Skip to content

Commit

Permalink
Ignore stopObservingElementInfo calls when not adaptive stream (#506)
Browse files Browse the repository at this point in the history
* Ignore stopObservingElementInfo calls when not adaptive stream

* Add change set

* Fix formatting
  • Loading branch information
davidliu authored Nov 12, 2022
1 parent 3ceee96 commit d448805
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-geese-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Ignore stopObservingElementInfo calls on RemoteVideoTracks when not adaptive stream
4 changes: 4 additions & 0 deletions src/room/track/RemoteVideoTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ export default class RemoteVideoTrack extends RemoteTrack {
* @internal
*/
stopObservingElementInfo(elementInfo: ElementInfo) {
if (!this.isAdaptiveStream) {
log.warn('stopObservingElementInfo ignored');
return;
}
const stopElementInfos = this.elementInfos.filter((info) => info === elementInfo);
for (const info of stopElementInfos) {
info.stopObserving();
Expand Down

0 comments on commit d448805

Please sign in to comment.