According to the book for a binary compound, first we assign the element with greater electronegativity its oxidation number (oxygen always -2 except in peroxides). So, we have -2 x2 =-2. So, each oxygen would have an oxidation number of -2. The book says the answer is -1.
The only thing I can think of, is since barium is an alkaline metal, it has an oxidation number of +2, so each oxygen would be -1. But, it contradicts itself because in the rules. It says for a binary compound, "the element with greater electronegativity is assigned a negative oxidation number equal to its charge in simple ionic compounds of the element."