It used to be that if you clicked on an appropriate embed tag on a web page in the Android browser, it would launch the youtube app. Now that the browser has its own youtube plugin, it seems to run that instead.
How can I get the old behavior?
Youtube's web pages still have the old behavior, but I can't understand their javascript.
Thanks,
Dawg
A link like
YouTube Video
with video id does the trick. See, for example,
http://it-ride.blogspot.com/2010/04/android-youtube-intent.html
Related
With the YouTube API you can construct ad hoc playlists on the querystring like this...
https://www.youtube.com/v/jdqsiFw74Jk?playlist=ylLzyHk54Z0,-vH2eZAM30s&autoplay=1
When this is a link on a web page, viewed on an Android device and the YouTube official app is selected as the default app to launch when these links are clicked, it only plays one of the videos and does not show any playlist like you see on the web.
Even if you select the browser as the default app, it just downloads the first video, but then it is unplayable.
I do not want to create a predefined YouTube playlist ahead of time with the videos defined - I know that will work - this feature of my site is designed to allow the user to autoplay a selection of videos at the touch of a button on the web and on mobile.
I have looked at all sorts of combinations of defining the url but alas, no joy with any combinations.
Anyone got this to work or have any suggestions of things to try?
Thanks!
I used this code to play youtube video using native youtube app.
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("vnd.youtube:zAhzo0JCbFY")).putExtra("force_fullscreen",true));
It works fine. But thing is its a clickable video like this:
http://www.youtube.com/watch?v=zAhzo0JCbFY
Youtube app doesn't allow the links to be clicked. Is there anything to be done(only with native youtube app)?
SORRY
The only thing you can do is to wait for the YouTube app to implement this.
BUT
You can find some alternative, including showing the video in a webview (if you manage), showing the links natively (if you have them), or just using the browser.
In all these cases, it is not the Youtube app.
You can do this by using <intent-filter>. I do not now the exact procedure but this explains it well.
I'm using adobe dreamweaver CS6 and jQuery Mobile to develop Android applications. After developing, my apps are put together by phonegap. Here I have the following problem: I have some buttons related to YouTube links, but I want them to open in the YouTube app. I'd like to work only in Dreamweaver, and use plug-ins only if necessary. I've already read about "intents" and "URL-s", but I don't know how to use them and how they work in dreamweaver. I haven't found any good tutorials on it yet.
Please be detailed if you can.
Normally you can simply link to youtube. The youtube app will handle the request and will start if the user allows that.
The youtube app has a special intent handler where the urls to youtube will be catched. So normally on the first link to youtube the user will be asked if the youtube app should be started or the browser(s).
Such a link what works in a native android application would be: http://www.youtube.com/watch?v=xxxx
So in dreamweaver/html it should look like this:
Some Video
I want to call android application on clicking of button on some website from mobile.
Suppose I am opening one url on android browser and I want to call my application on clicking on button provided by that site. How to do that??
Suppose we are using browser other than Chrome then is it allowing??
If you link to your application as "myapp://foo/bar", can't you use some sort of intent filter to start your application.
I mean, if you press a youtube link in the browser it asks if you want to complete the action with the YouTube app or the browser.
I have seen similar examples regarding Google Maps links (which would open in either browser, google maps(?) or GeoBeagle).
Please take a look at the WebViewDemo. Javascript code in the web page can call into your Activity. As well as the other way around.
You cannot... if the site is being browsed in the default browser (Chrome).
If you already have an application that embeds the WebView, then you can do some bit of handling of - mouse clicks, window alerts, navigation etc. Otherwise, not!
In my android app I have a WebView to display html data from our website. Sometimes the page will have youtube embed objects. This doesn't show up properly in the app. Is there any way to show/play youtube videos in WebView ? Thanks.
You cannot show them embedded except perhaps on devices that have Flash.
However, if you can parse out the YouTube video details, you may be able to construct an ACTION_VIEW Intent that will show them on the YouTube application...for those Android devices that have the YouTube application.
You might also experiment with HTML5's <video> tag, which AFAIK is supported in the Browser application and may therefore work in WebView.
I came accross this post: link
And indeed, I basically only needed to add to the application manifest xml:
android:hardwareAccelerated="true"
And voila, even the youtube video's started playing
webView.setWebViewClient(new WebViewClient()
{
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
// YouTube video link
if (url.startsWith("vnd.youtube:"))
{
int n = url.indexOf("?");
if (n > 0)
{
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("http://www.youtube.com/v/%s", url.substring("vnd.youtube:".length(),n)));
}
return (true);
}
return (false);
}
});
You WebView (webView) will send you the shouldOverrideUrlLoading message with a URL that looks like this:
vnd.youtube:{VIDEO_ID}?{PARMS}
Parse this to convert it to http://www.youtube.com/v/{VIDEO_ID}, then hand off this revised URL as an Intent.
Works for me...
Read my post on the android-developers group here: YouTube in the emulator?
Basically, the best way to play YouTube clips is to create your own Activity for it, and here's a great example: Polish Your App: Free Embeddable Android YouTube Activity!
UPDATE: The problems with the incompatibilities due to YouTube token changes have been fixed. Latest version of the component should work just fine for public YouTube videos.
You could try switching your website to embed the HTML5 version of the YouTube player instead of the flash version. Still not sure this will work 100%, but it's obviously going to work better than the flash version on devices that don't currently support flash.
Edit: Nevermind it looks like the HTML5 version also requires the browser to support the H.264 codec, which it doesn't look like any Android devices currently support.
Embedded youtube videos work fine in desktop browsers and in iPhone browsers (even when embedded in apps on iPhone), so it seems to be problem with Android rather than YouTube.
There is a library I use for html5 video tags in the android WebView, it works for all youtube videos and most flash videos as well, supporting entering and exiting fullscreen among other features.
VideoEnabledWebView by cprcrack