Why does my music still play from my iPhone when plugged into a dock?

I have an iphone five and have purchased an adaptor cable. It comes up to say it's charging (plugged in) but when i play music it does not play thruogh the dock, instead through the normal speakers of the iphone, any help?

Try going into music when its plugged into the dock and pause the music playing, thats what happens to me and then i pause the music and its fine

Pause before you put it on the Dock.