This worked:
I has the same problem..when i slide the lower bar and click on air play it showed that the sound is coming through the doc connector speaker that is why IPAD speakers are not working. I tried all the you tube stuff/resetting/cleaning/going thorough sound seeings and also called apple store but nothing work.
This is what i did that worked:
First i cleaned the charger connector by just blowing in it. I used box cutter blade edge and just started to slide through the ipad doc connector slowly while kept the lower bar open in air plane dialog that constantly showed doc connected.. i gently slid the blade from right to left i realized that when my blade was close to the left side of the doc connector the doc sound converted to IPAD sound and while i keep it there the speaker worked. Then i slide the blade multiple time left and right scraping that doc connector few times and whenever the blade was in left side: it again showed ipad sound instead of doc sound..then i kept the blade there while it showed ipad sound for 30 seconds and then gently twisted the blade clock wise and then anti clock wise 2-3 times and then removed the blade..and the sound remained at ipad sound and now the speaker worked.
i was using a old almost broken charger cable that caused the problem i think so i replaced with new charger cable and speaker is working well now
Remember this technique should be the last resort if nothing works and there is risk of breaking doc connector if you twist the blade too hard..you just have to twist it lightly/gently and i guess there are two pins that connect and it removes doc mode.
Hope this helps!!!