
mehagar
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 Prag Prog topics







Modern Front-End Development for Rails - application does not start after run bin/setup (page xviii)

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:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /centos
- /ash
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /sublime-text
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /spring
- /django
- /diversity
- /lua
- /nodejs
- /slackware
- /julia
- /c
- /neovim