When ever i press Space in Rhythmbox the song starts over instead of going on pause and when its on pause and i press Space the song starts over again instead of resuming from where it left of.
So my question is how can i change this so it will toggle between pause/play?
rythymbox's keyboard interface is incoherent.
The desired behaviour, (which imo is desired behaviour for all music players at all times,) of space bar being play/pause button, is actually possible after you click play or pause with the mouse. It is like it 'selects' that button.
However, after you select a track for example, the spacebar behaviour changes to selecting that track, so everytime you press pause, I mean spacebar, it will again select that track, and because it is playing it will start playing the track again. I hope this will get fixed sometime into something more sensible and intuitive. Like the desired behaviour.
You would need to change the source, as space in a tree typically means "activate the current selection." And this describes the behavior you're seeing exactly.
However, it does appear that pressing Ctrl+Space gives your desired behavior.
You are ~probably supposed to also be able to change the setting for global play-pause in gnome-control-center -> All Settings -> Keyboard -> Play (or Play/Pause), which I think is by default set to Control-Space.
But, it won't let you set Space as an option since that would conflict with other applications. It's also not working for me at the moment; there might be other pieces of gnome that I don't have loaded cause I'm not running a full gnome desktop.
This isn't really a solution, but at least provides a bit more info on the misbehaving subsystems.
You have to press "Ctrl+P" to play/pause apparently (at least on Gnome in Ubuntu 20.04, where I tested it).
For some reason this information is not easily accessible.
See https://help.gnome.org/users/rhythmbox/stable/shortcuts.html.en for more.