Android WebView One Column doesn't work with YouTube videos
Asked Answered
S

0

1

I am loading RSS data from URL,and that RSS data can contain link to YouTube video.

Here is an example how link to youtube vide looks like:

div class="video-shortcode"><iframe title="YouTube video player" width="600" 
height="350" src="http://www.youtube.com/embed/HXrcUyCVA6c"
frameborder="0" allowfullscreen></iframe></div>

When I use this code, I get preview of YouTube video and I can play it, but images are to large as shown on the image below. enter image description here

I used this code for WebView:

WebView desc;

WebSettings ws = desc.getSettings();

ws.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);

When I tried to use this code for WebView:

ws.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);

It seems that YouTube videos dont work, because they are black, and I can't play them.

Looks like this: enter image description here

Swinton answered 22/7, 2013 at 15:50 Comment(2)
Which android version are you using? And what are your android minSdk and targetSdk values?Middy
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />Swinton

© 2022 - 2024 — McMap. All rights reserved.