question

qtoppler avatar image
qtoppler asked

View Youtube videos?

Is there anyway to view Youtube videos on Kindle Fire? Ideally within the app? The standard youtube intent has no associated Youtube video viewer, nor do I see videos when on a webpage. Thanks
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dixith@Amazon avatar image
Dixith@Amazon answered
Hi, Using Android standard youtube intent you can be able to view youtube videos in Web page and within the app as well. Below is snippet of code where it launches the Android youtube intent for youtube videos. Uri uri=Uri.parse("you tube url"); Intent intent=new Intent(Intent.ACTION_VIEW, uri); Please go through the below link for more information. http://developer.android.com/reference/android/webkit/WebView.html This works fine with Kindle Fire devices. Hope this information helps. Thank you.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mahalodev avatar image
mahalodev answered
Dixith, I had the same question, and unfortunately you didn't answer it at all. To tell the OP to just launch the browser with an Intent set to the youtube url is pretty, well...lame. You didn't even specify what the youtube url should be! I was hoping that the Kindle had some kind of API for handling youtube videos. Guess not. Any app that launches the browser, takes you to the youtube page, and then requires you to press play on the video frame....sucks. The OP also asked how to play a video in the app, and your response was the URL to the WebView class. Well how is that supposed to work? So the youtube page is inside the app? That's pretty bad too. You didn't provide any sample code showing how to only link to the youtube frame and nothing else. By the way, the way you do that is to use the URL " http://www.youtube.com/embed/YOUTUBE_ID?html5=1". My problem is that I can't get the video to play. Please, if you're going to answer a question, then answer the question.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dixith@Amazon avatar image
Dixith@Amazon answered
Hi, Sorry for delay in getting back to you. In order to play the Youtube videos, set the web chrome client and use the iframe tag in your application. Make sure to add the internet access permissions in Manifest file. Please find the code snippet below. final WebView webView = new WebView(this); setContentView(webView); webView.getSettings().setJavaScriptEnabled(true); webView.setWebChromeClient(new WebChromeClient()); final String html = " "; webView.loadData(html, "text/html", null); Please find the below thread for more information. https://forums.developer.amazon.com/forums/thread.jspa?messageID=1595ػ
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.