Hi @Md. Niaz Mahmud ,
Welcome to Microsoft Q&A!
I want to know whether media was played or paused by "Earphone Button Action" or not.
Currently there is no API in UWP that can achieve your needs.
I also tried looking for related APIs in Win32 but couldn't find any. The feasible technical route is that you need to write your own driver to detect your earphone's events.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.