That Cast Button

Chrome wants to let you cast any video or audio from a phone. Even if you don't want it to be castable.

Fortunately, the fix is pretty easy. Just use:

video.disableRemotePlayback = true;

This will prevent a cast icon from showing up on videos that you don't want your users to be able to cast, like background videos.

Why isn't it instead something like

video.remotePlayback = false;

though?

Probably not for a good reason. It may be that since unset booleans default to false in most programming languages, this was easier to implement and have videos default to being castable. But I feel like it's pretty sloppy.

That's the fix anyhow.

#WebDevelopment

Posted 4 Mar 2019 by Josh