"He played with the computer all afternoon."
Translation:Celé odpoledne si hrál s počítačem.
Actually, I'd say hrát (hry) na počítači 'to play (games) on the computer' or hrát počítačové hry 'to play computer/video games' is more common. I suppose that is what you are asking about.
Hrát si s počítačem sounds to me as if you were 'playing' with the computer physically/tinkering with it.
Here, in the Czech sentence, it is like a toy. Similar to "Celé odpoledne si hrál s míčem." = "He played with the ball all afternoon."
Like a partner would be "Celé odpoledne hrál s počítačem." The English stays the same and can possibly mean both. Or against computer, "hrál proti počítači".
Musical instruments use "hrát na": "Celé odpoledne hrál na piano."
This simply differs from verb to verb. Some use varios prepositions and some use direct objects. Some change their meaning between these two versions: Hrál tenis, hrál na kytaru, hrál si s hračkou. He played tennis, he played the guitar, he played with a toy.
For playing video games on a computer we usually say: Hrát na počítači."