Programming WebRTC: confusion about disabling a video track
In P1.0 of this book, in the "Wiring up the A/V Toggle Logic in JavaScript, it says:
“The toggleVideo() function is almost identical to toggleMic(), but with one key difference: by disabling a video track (video.enabled = false), the video will appear to be frozen when in reality the peer will stop sending new frames of video. But a frozen video frame will make a live stream appear broken. So we’ll need an additional piece of logic to add or remove the video track on $self.mediaStream:”
But after testing, it seems that setting video.enabled = false does keep sending frames, just black ones (also mentioned here: MediaStreamTrack: enabled property - Web APIs | MDN). What causes the self video to be frozen is actually using the removeTrack in the same example - that will stop showing video frames at all in the self video.
Popular Pragprog topics










Modern front-end development for Rails, second edition - Struggling to get the first chapter to work
Other popular topics










Latest in Pragprog
Latest (all)
Categories:
My Saved Portals
-
None saved yet
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /v
- /react-native
- /wasm
- /security
- /django
- /nodejs
- /centos
- /haskell
- /rails
- /fable
- /gleam
- /swift
- /js
- /deno
- /assemblyscript
- /tailwind
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /preact
- /flutter
- /c-plus-plus
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /vuejs
- /nim
- /emacs
- /nerves
- /elm