The sentence describes an action that was in progress for a duration in the past. The past continuous tense is used to express this. The subject 'The boys' is plural, so the auxiliary verb should be 'were'. Therefore, the correct form is 'were playing'.