National anthem

When and where did the tradition of playing the national anthem before sports events begin? And why only sports events? I mean, we don’t play the anthem before theater productions or other mass gatherings. I’m going to guess it began in Europe in the fascist era before WW2 as a way of connecting the virility of sport with patriotism to the fatherland, but please enlighten us!

In a couple of reference books plus a couple of seemingly accurate web sites they mention its connection to American sporting events.  It’s mentioned that in Japan, their national anthem is not sung before baseball games, so this is perhaps a North American thing.  Anectotally, it was performed at baseball games even in the nineteenth century, but is first well documented during the patriotic ferver of WWI (apparently some thought that professional baseball players were avoiding military service, so it was sort of a public relations gimmick).  It was only performed before games on special holidays and the like until WWII, when it came to be performed regularly before games.  Other sports picked it up.  See the books The Cultural Encyclopedia of Baseball by J. Light or Sport in American Culture by J. Duncan.