Can I play music in my online class?

Yes. However, you will need a music licence to do so. The music is not for your personal use and is used to benefit your audience, and this requires a licence. 

According to The Copyright, Designs and Patent Act of 1988, using music to benefit your customers and or employees in a non-domestic setting requires permission from the copyright holder, something you can obtain with a music license. Each country has its own version of this Act. 

For more information on getting a music license in the UK, head here: https://pplprs.co.uk/

For Ireland, head here https://www.imro.ie/