The Byzantines were viewing them as a different people (at least the Serbs and the Croats as far as I know), but they knew that they were both Slavs.
For example, Emperor Constantine VII Porphyrogennetos describes them in a text that was meant to educate his son on how to govern the Empire.
http://homepage.univie.ac.at/ilja.steffelbauer/DAI.pdf
On page 147 of the book (153 of the pdf) it describes the Croats.
On page 153 of the book (159 of the pdf) it describes the Serbs.
The Ottomans tended to view their subjects by religion, until the various national awakenings that happened through the 1800s and in the case of Albanians and Macedonians, 1900s. The empire was organized into several millets- self governing courts for non-Muslim religions. The entire non-Armenian area was known as the Rum with Georgians, Greeks, Serbs, Montenegrins, Bulgarians and Romanians all having the same access to these courts.
Bosniaks as they're now known would have been simply Muslims. Catholics were viewed as separate nations, Hungarians Croatians Slovenians and Germans would have been grouped together at various times.
It's not until the after French Revolution that the idea of nations and nation states spreads to the Balkans.
I'm travelling now so I only have one book with me, the Mark Mazower book could have some insight into the Byzantine empire. It's a fairly short and comprehensive read of the Balkans.
Source: Misha Glenny, The Balkans 1802 - 2008