question

claudiucolteu avatar image
claudiucolteu asked

Kindle Fire HD not playing youtube video using iframe in a web view

I am trying to play a YouTube video on a KindleFire by loading in a WebView. It works fine on Kindle Fire 1st gen, but on the Kindle Fire HD it loads the video thumb and the red overlapping play button but once clicked the video does not play. Any suggestions how the get the video to play ? Thanks.
fire tablet
10 |5000 characters needed characters left characters exceeded

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
Please raise a contact us( https://developer.amazon.com/help/contactus.html) with your sample code of playing a youtube video. Then one of our support engineer will assist you further.
10 |5000 characters needed characters left characters exceeded

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

Jennifer A Niles avatar image
Jennifer A Niles answered
I am interested in this solution also, I've created an HTML Bootstrap Twitter framework page, I've inserted two different
10 |5000 characters needed characters left characters exceeded

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

Jennifer A Niles avatar image
Jennifer A Niles answered
Nevermind. I was trying the device with mobile wifi and switch to a faster wifi and it worked just fine.
10 |5000 characters needed characters left characters exceeded

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

claudiucolteu avatar image
claudiucolteu answered
Can you share your html snipped (including the iframe) that allows you to play the video within a WebView in the Kindle Fire HD ? Thanks.
10 |5000 characters needed characters left characters exceeded

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, We have tested video on KindleFire HD 7 inch device and can able to play video without any issues. Please find the below code snippet. final String html = " "; webView.loadData(html, "text/html", null); Hope this information helps you.
10 |5000 characters needed characters left characters exceeded

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

claudiucolteu avatar image
claudiucolteu answered
Thank you for your answer. Here below is my code. It works on Kindle Fire 1st gen, but DOES NOT on the Kindle Fire HD. I can see the 1st I-frame of the video but once I hit play it loads indefinitely. I checked internet connection, I added the proper permission to the manifest file, etc... What am I missing ? (sorry for the formatting, not sure how to post code on your form). public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView v = (WebView) findViewById(R.id.webview); v.getSettings().setJavaScriptEnabled(true); v.getSettings().setPluginState(PluginState.ON); final String html = " "; v.loadData(html, "text/html", null); } }
10 |5000 characters needed characters left characters exceeded

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

claudiucolteu avatar image
claudiucolteu answered
I figured it out. I was missing v.setWebChromeClient(new WebChromeClient() {}); as per Google's documentation: http://developer.android.com/reference/android/webkit/WebView.html "In order to support inline HTML5 video in your application, you need to have hardware acceleration turned on, and set a WebChromeClient."
10 |5000 characters needed characters left characters exceeded

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
Good to know that your issue was resolved. This information would help other developers in the forum.
10 |5000 characters needed characters left characters exceeded

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