Yes, the player of the Beast Master Ranger does control his/her animal companion. As you quoted:
The beast obeys your commands as best as it can.
It doesn't take an action unless you tell it to. It doesn't move unless you tell it to. It can use its reaction freely (e.g. for an opportunity attack), though it presumably would only attack a creature that you'd expressed hostility towards or vice versa.
In practice, this means that the Ranger player does indeed control what the animal companion does. There's no specific range restriction in which the companion can be commanded, but unlike Find Familiar and Find Steed, there's no telepathic bond between a Beast Master Ranger and their animal companion - so the only way to command the animal companion is verbally (or maybe with gestures, though I don't think there's any RAW description of that).
The 1st-level spell Beast Bond does make telepathic communication possible:
You establish a telepathic link with one beast you touch that is friendly to you or charmed by you. The spell fails if the beast’s Intelligence is 4 or higher. Until the spell ends, the link is active while you and the beast are within line of sight of each other. Through the link, the beast can understand your telepathic messages to it, and it can telepathically communicate simple emotions and concepts back to you. While the link is active, the beast gains advantage on attack rolls against any creature within 5 feet of you that you can see.
It's a Touch-range concentration spell that lasts up to 10 minutes.
(Beast Sense is another spell that essentially lets the animal companion function like a familiar; it's a 2nd-level concentration spell that lets you see and hear what a willing beast sees and hears, for up to an hour or until you use an action to stop doing so.)
In other words, the player controls the animal companion as long as it can hear the Ranger's verbal commands, or as long as it's within line of sight if the Ranger casts Beast Bond on it.
If the Ranger falls to 0 HP (or otherwise falls unconscious), Mike Mearls says he would rule as a DM that "I'd let it protect and aid ranger" - after all, the animal companion does have a special bond with the Ranger.
In addition, he replied to a question about what would happen to the animal companion if the Beast Master Ranger actually died as follows:
I'd let the companion stick around as a DM run NPC. Might remain friendly to the ranger's companions
Again, though, this is Mike Mearls' personal opinion as a DM, not an official declaration of the rules.
In summation: the Ranger's player controls the animal companion as long as the Ranger is able to somehow command the companion. The DM would likely control the animal companion in most other cases.