The Beoplay A2 connects via Bluetooth (lossy) and i imagine a line in. The H9s connect again via bluetooth (lossy) and line in.
Andy_js is correct in that you would be wasting your money as both products above particularly the A2 are not Hi-Fidelity devices and dont have stereo separation (A2). Most of the money of the H9s goes to materials and Noise cancellation.
A phone will suffice but If you have an iphone the problem is confounded by the fact iphones dont support Bluetooth APxt which has supperier codes over bluetooth. The DAC in iphones are ok but not great. Some android phones like the LG V20 series are great all in ones as they have a fantastic DAC and its also a phone.
To get the most out of portable player (with a good DAC built in) you need hi-fidelity speakers/headphones. I have a chord mojo DAC (£399) connected to my iphone via lighting/USB and i use either camfire Vega in ears (£1K) or my Oppo PM3 overear headphones (£1K)
Have a look at this list for players.