I grew up the in the former Yugoslavia, and the language I studied in school was called Serbocroatian, which was spoken in four out of the six republics of the union.
You were basically studying the standard, 'literary' language. And then, you were mostly focused on your version of Serbo-Croatian [SC].
There were at least 4 versions. They were called 'Western', 'Eastern', 'Ekavian', etc.
You weren't systematically studying all these versions. Very few people did learn systematically - in school - differences such as:
mrziti ≠ mrzeti
grijati ≠ grejati
brijati = brijati
and such as:
komentirati ≠ komentarisati
definirati ≠ definisati
trenirati = trenirati
Not to mention that nobody was learning this in school, for example: https://youtu.be/G2YJr5JNnnM
Can you understand all of it? I had really problems with some words. Is it the same language? Is he singing in SC? Or not?
There's another problem, a very practical one. In Croatia, spelling naprimjer 'for example' is acceptable. In Serbia, it's not, you can only spell it with 2 words (na primer). So imagine a teacher in school who has to prove to a student that naprimjer is acceptable. There has to be a book which proves it, an orthography manual. What will be written on the cover of it?
SC orthography? But it would describe only spellings acceptable in Croatia. Croatian SC? Standard Croatian Serbo-Croatian?
Since laypeople usually equate 'language' with 'proper spelling' and 'standard language', the only option is to write Croatian on the cover.
Linguistically speaking, one can say that:
- what is spoken in Zagreb, Split and Belgrade is not the same, but it's similar
- people can still understand each other without misunderstandings, but there are funny moments once a while
- dialects don't follow political or ethnic borders, except in a small number of situations
There's something more. People who were born and raised in Serbia or Bosnia-Herzegovina often underplay actual diversity of speech. I, living in Zagreb, can sometimes only barely understand people living in a village (in Croatia!) 40 km from Zagreb. They might be speaking Slovak, as far as I am concerned. What are they speaking? Is it the same language? Or we call it a dialect? Why?
People in Serbia and Bosnia-Herzegovina often don't think dialects are important in the everyday life. Now listen to the YouTube link again. Dialects are very important in Croatia, and many people actually consider their native dialect "the true language".
So, depending on your view, there is maybe only one language with many dialects and variants (some incomprehensible to you), or 4 or 10 languages.