How to get direct link to video? - android

I have a problem with playing video in my app. Basically what I want to do is getting direct link to video like: www.embed.videotube.com/player/?id=431436[...].mp4 from: http://embed.videotube.com/player/?id=431436. I've seen some websites like www.videotools.12pings.net which will get proper link.
Is there any option how to cope in situation where there is no proper API ? (example: api for youtube)
After clicking on video thumb:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("www.embed.videotube.com/player/?id=431436[...].mp4"));
myContext.startActivity(intent);

That seems to be a direct link. You could verify it by running fiddler or any HTTP traffic monitoring tool, while playing the video, the video link will be displayed in the inspector window.

Related

Unable to stream YouTube Url in VLC android

I have already integrated VLC player in my android app in Linux environment.But now the issue is when i try to play the YouTube link .It Unable to stream the YouTube URL and the concerned g-data ".3gp" URL.The error is mentioned below.
"http://www.youtube.com/watch?v=oq1gNicFkeM can not be played." in Toast.
Does anyone have any idea on the same?
I have found a temporary solution.I'm not an expert, but this did the trick for me:
Find a website which can download youtube video's (I suggest keepvid.com)
Paste the url of your youtube video into the designated bar and, although we are not downloading anything, hit the Download button.
Now the website gives you a list with different formats for you to choose from. RIGHT-click the one on top (mp4?) and copy the link's adress.
This link can be played in VLC Android and includes your youtube video.
VLC for Android does not support the lua plugins needed to parse the YT URL.
You need to parse the HTML layout yourself (and feed the resulting URL to VLC) or add support for lua plugins to VLC for Android to solve this issue.

Direct link of Youtube video

I would like to get from the link http://www.youtube.com/watch?v=GzmpH7eaA4k the direct link of the video, something like: http://www.youtube.com/(...).mp4
Is it possible? I have seen a lot of threads that use "www.youtube.com/get_video_info" and other ways but I think that all of them are obsolete right now.
How can I get the URL that I need?
There is a easy way to find youtube direct video link using VLC Media Player.
Open VLC -> Media -> Open Network Stream -> Network -> Enter the youtube link (e.g. http://www.youtube.com/watch?v=7FKEy_RWwQk).
Now open the playlist-> Right click on Video-> Information -> You will find the below part of the screen in location textbox.This is the direct link of the video.You can open it in browser or save it to your local system.
If you want the direct Link to download a Video you have to use the "stram_map" attribute with the specific itag(quality). A great example how you can get the download link is shown here: Get the download URL for YouTube video (Android/Java) you can directly play the video in your own player or you could use it to download the video to your device.
Well I would go nab the link myself for you but you have the video not available in my country, USA, just simply click the share tab under your video and use that link.
I believe that get_video_info is deprecated. Try in stead:
http://gdata.youtube.com/feeds/api/videos/GzmpH7eaA4k
Keep up to date with the youtube api here: https://developers.google.com/youtube/

What does android web browser use for playing audio streams? MediaPlayer or something else?

I have rtsp audio streams from a specific site (m.aveamuzik.com) that play within a browser. When I try to play the same stream using MediaPlayer class, I get MEDIA_ERROR_UNKNOWN (with extra=-2147483648). The error is not well documented but a little googling shows that it is most probably because of unsupported media format.
My question is, if MediaPlayer class does not support some format, how does the built-in browser play it? Also, how to use the same mechanism used by the browser in my code, instead of the MediaPlayer class?
Edit 1: #Joe
I tried the following code:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(streamURL));
startActivity(intent);
MX Player and BSPlayer showed up as options to open the file, but not anything related with AudioPreviewActivity. Actually this is quite reasonable as my URLs are rtsp, but the intent filters for AudioPreviewActivity are just for http, file and content type of URIs.
Fact
The Browser has extra features set up to strip the video source from the page and launch it in the native player most of the time. This functionality is not built into WebView, and the native player is very picky about what needs to passed into it as a URI to be able to play it.
It works since Gingerbread in the default android browser.
Possible explaination
You probably don't use the MediaPlayer the way the android browser does. Post some code to help futher help.
Further help
The MediaPlayer has a lot of bugs before 4.0 (that fixed a lot a RTSP bugs).
The Web Audio API as described by W3C: link
Here is a detailed list of all media formats and protocols supported by Android: link
Testing page: link
This complete blog post also helped me about media streaming for Android: link
If it looked like the screenshot on this other question when it is playing in the Browser, then it should be the AudioPreview Activity from the Music app.
You should be able to
launch it by simply calling startActivity() with an Intent that matched one of its IntentFilter in the manifest.

play youtube video in full screen mode in my android app

I am using the following code to play youtube videos in my app.
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.youtube.com/watch?v=videoid")));
I would like the youtube videos to open in full screen mode. Is there any way to achieve this?
Found this solution today:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=VIDEOID"));
intent.putExtra("force_fullscreen",true);
startActivity(intent);
Try using
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube://" + video_id);
startActivity(intent);
The reason is the different Uri. The one you are currently using is just supplying content via http: that happens to be video and get's resolved to youtube. The one with "vnd.youtube" is actually telling the system that you have video content you would like one of the native apps to take care of.
Ahh, if you want to actually play full screen video without using the youtube app (which you can not control) you don't you try to just make your own VideoView?
Check out this link
playback video full screen
Although I failed at this initially, I eventually succeeded by following the instructions at this linkc
http://keyeslabs.com/joomla/projects/youtube-player/244-open-youtube-activity-project-launched-by-keyes-labs
Here you create your own video player and the video gets played in it

In android, is it possible to get the current http url when the youtube app is playing video?

My goal is to create an app that can know the name of the current video playing in youtube app in android. I have found it is impossible(possible?). So maybe there is a way for me to know the current video's url ( then maybe I can obtain the video id from the url).
Is it possible? I have check the youtube process's proc folder, but I didn't find such information. Because the youtube app doesn't use an browser, is it possible for me to know such information? thx:>

Categories

Resources