The relevant meaning in French (that is indeed listed in etymonline) is medium.
If you look in the French Larousse from 1863 (via Google books), it says:
Phys. Fluide qui environne les corps: l'air est le milieu dans lequel nous vivons.
This is clearly the meaning adapted into English. Translated, this means
Phys. Fluid that surrounds bodies: air is the milieu in which we live.
Surprisingly, the translation of this physics sense of the French word milieu is the English word medium, which also translates the quite different everyday French meaning of milieu (ie = middle in English). One might think that the French and English physicists had been talking to each other.
Of course, you then get the questions of how the word medium came to have this meaning, and whether medium was used for this in English before milieu in French, or vice versa.
Meaning "intermediate agency, channel of communication" is from c.1600.
So my guess is that a substance through which waves are carried is called a medium because it is an intermediate between the sender and the receiver. And this meaning got broadened to be much more general, including (for example) a substance in which bacteria are cultured.