Music and trail etiquette

Back in the spring I was running in a trail race and encountered another runner wearing a portable speaker and playing music loudly on the trail. I made a snarky remark and we had a mildly spicy exchange, not a big deal, but I keep wondering if I'm in the wrong here or if there's a standard of trail etiquette about this. I wouldn't be bothered at all by the same behavior on a road race, but imposing your music on everyone else during a trail run strikes me as wildly antisocial behavior. AITA?