I need to play some videos in my application. I am using the following bit code for the same:
vid="0ee3R3tfdd4"; //the video id of the youtube video
url="vnd.youtube:"+vid;
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
The video works well on a normal device. However, it gives "Activity not found" exception on an emulator. I think the reason being that youtube app may not be installed on the emulator.
I would like to know:
- Can this be a problem on an actual device. I have seen that every device has a youtube app
- How to ensure that the app works well on a device irrespective of whether youtube is installed or not.