Best way to play a video file?

I have a url for a video file that I need to play using my phone’s own video player.
I decided to use Intent.ACTION_VIEWand set the URI as Intent data, I can achieve the above on G1, except for HTC Hero. In the case of the Hero, I must explicitly set the class name in the intent in order to start the default video player:intent.setClassName("com.htc.album","com.htc.album.ViewVideo");

However, I do not like this approach, as it can break on other Android devices. Please advice:
1. What would be the best way to play this video through Intent, regardless of phone?
2. How conditionally setClassName in tube-specific Intent?

Note. Writing a standalone video player for our application is NOT an option that we can currently afford.

Thank!

+3
source share
1 answer

Note. Writing a stand-alone video Player for our application is NOT an option we can afford at the moment.

Firstly, the video player is not part of the SDK , and relying on it is a big mistake, as you have already discovered.

-, 40 , , 40 , .

+8

Source: https://habr.com/ru/post/1729194/


All Articles