dryer heats, only spins sometimes

I have a commercial stacked electric dryer/washer. Currently the dryer only works sometimes. After closing the door and selecting a dry cycle the timer will start and count down, and the dryer will become warm, but the drum only spins occasionally, and if it does spin it will shut off after a minute. The fan will also turn off when the drum stops spinning. Does this mean I have a bad thermostat? Or something else?