While camera loads then audio is playing(Wrong speaker) at earpiece in place of speaker in iOS17 only

In My PWA app I am using camera of getUserMedia() and html audio tags, So In my app I am using videos audios and camera based on requirements, so When I have updated iOS17 I have stared facing below issue.

When I am loading camera after premission given. my audios are playing in ear speaker and not in media speaker only for ios17, older ios versions it is working fine.

I am using javascript, angular, ionic with html5 css for developing my app.

Please provide solution.