diff options
Diffstat (limited to 'client-web/source/track_handle.ts')
-rw-r--r-- | client-web/source/track_handle.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/client-web/source/track_handle.ts b/client-web/source/track_handle.ts index 98b2b2f..1bb9265 100644 --- a/client-web/source/track_handle.ts +++ b/client-web/source/track_handle.ts @@ -1,6 +1,8 @@ /// <reference lib="dom" /> export class TrackHandle extends EventTarget { + stream: MediaStream // this is used to create an id that is persistent across clients + constructor( public track: MediaStreamTrack, public local = false @@ -15,12 +17,14 @@ export class TrackHandle extends EventTarget { // drop all references to help gc track.onunmute = track.onmute = track.onended = null }) + + this.stream = new MediaStream([track]) } get kind() { return this.track.kind } get label() { return this.track.label } get muted() { return this.track.muted } - get id() { return this.track.id } + get id() { return this.stream.id } //!! end() { this.track.stop(); this.dispatchEvent(new CustomEvent("ended")) } } |