I have a pretty old MacBook Air (bought it in 2011), so I'm thinking it's probably to do with the keyboard wearing out. But I'll be watching a video or something and the volume control will run up to the max, as if holding down F11, or run all the way down as if holding down F10. (Since I installed High Sierra, these keys have shifted one over to the right, so F12 and F11 really.)
I've tried several things: restarting system, cleaning keyboard, etc., setting it up to hold down the Fn key as well as the function key (doesn't change anything), installing updates. Nothing seems to help.
So, unless anyone has any other ideas, I'm presuming that the problem is hardware-related. I don't really use the system volume control anyway; prefer to control it from within the video itself. Is there a way to disable it, without disabling the ability to control it from within, say, youtube videos?
(Edit: I tried resetting the PRAM by holding Option-Command-P-R on reboot after a complete shutdown. The problems haven't reoccurred after some hours of use. I'll post it as an answer if the problem doesn't resurface after I give it a day.)