The phenomenon goes back a lot farther than that, however! Many operas are now rarely heard in full because the librettos aren't very good or the stories have fallen out of favor, but the music lives on, at least in excerpt form or in the overtures. There was also another outlet for dramatic music in the ages before film: incidental music to plays. The famous march that we often hear at the end of weddings? That's by Felix Mendelssohn, who wrote that as part of a suite of incidental music for A Midsummer Night's Dream. Of course, the Shakespeare play has not vanished into obscurity. But virtually gone is a play called Rosamunde, which would be completely and utterly forgotten today if not for incidental music written for it by the great Franz Schubert.
Schubert is, depending on how you think about his music, either the last of the Classical composers or one of the earliest Romantics. Schubert did not live long, but in his short life music poured out of the man, including this suite of incidental music for Rosamunde, a play by Helmina von Chézy. The play, by all accounts, was not terribly successful, and in fact the original text is now lost. The story apparently involved (according to this old New York Times article): "a cursed princess, who had been brought up by sailors, a pursuer, who travels around with poisoned letters - whoever reads them, dies - and a prince, who has to live among shepherds; there is a mysterious shipwreck and, further, ghosts, hunters, and shepherds." Frankly, all that sounds kind of fun to me, so for the play to have failed miserably must be indicative of some terrible writing.
But Schubert did able work in writing the incidental music! The overture is best known, being a suitably thrilling piece that almost evokes Rossini, but the entire suite from the play is something of a delight. Hearing this music, written by one of the greatest composers of all time, we might be tempted to think that the play must have been good, if it inspired music that good. Take the lesson we learn from Jerry Goldsmith's career, though, to heart: This is not so.
Here's the overture and incidental music from Rosamunde, by Franz Schubert.