I need to display real time video stream from laptop camera to android app. Because i don't know how to stream video so i use youtube to stream video for me and it works fine. Now i need to dis play a stream video from youtube to android app. Current i'm using videoview so i need get direct link of stream link ( for youtube video i can use this YouTubeExtractor ) but this library doesn't work for stream link. How can i do the same with stream link ?
Asked
Active
Viewed 473 times
2 Answers
0
Try something like this:
public static void watchYoutubeVideo(String id){
Intent appIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:" + id));
Intent webIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.youtube.com/watch?v=" + id));
try {
startActivity(appIntent);
} catch (ActivityNotFoundException ex) {
startActivity(webIntent);
}
}
Community
- 1
- 1
Jay Hamilton
- 51
- 6
0
Use the YouTube Android Player API , it allows you to play any youtube video, given the video id that you can extract from any youtube link.
Merlevede
- 8,078
- 1
- 23
- 39