bug 705572 - Kindle Fire: YouTube videos do not open in unavailable YouTube App r=dougt,mfinkle

This commit is contained in:
Brad Lassey
2011-12-05 16:57:33 -05:00
parent cfbd7adb0e
commit 7fd6973d83
5 changed files with 151 additions and 4 deletions

View File

@@ -811,6 +811,18 @@ public class GeckoAppShell
intent.setDataAndType(Uri.parse(aUriSpec), aMimeType);
} else {
Uri uri = Uri.parse(aUriSpec);
if ("vnd.youtube".equals(uri.getScheme())) {
// Special case youtube to fallback to our own player
String[] handlers = getHandlersForURL(aUriSpec, aAction);
if (handlers.length == 0) {
intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName(GeckoApp.mAppContext.getPackageName(),
"org.mozilla.gecko.VideoPlayer");
intent.setData(uri);
GeckoApp.mAppContext.startActivity(intent);
return true;
}
}
if ("sms".equals(uri.getScheme())) {
// Have a apecial handling for the SMS, as the message body
// is not extracted from the URI automatically