Playing a video volume through Ear Piece speakers in ionic?

I am trying to play the video through the Ear Piece speakers.
While doing some research I found there is a cordova plugin ‘AudioToggle’. I am not able to install that plugin.

Can any one please help and let me know what is the best way of switching the phone speaker to ear piece speaker?

any solutions if any one has come across