I'm having a problem to show embedded youtube video on Android. The area of
the video is left blank, but if I tap the overflow menu and then double tap
the location of video, the video appears. On simulator and iOS, the youtube
video shows correctly.
If I change the height style of the iframe to another unit (px or em), the
video appears but the size between devices isn't consistent.
I'm using the BrowserComponent to show the embedded youtube video, the
component is inside the BoxLayoutY and I'm overriding a method because the
vertical size of the BrowserComponent was big. I'm using the Gui Builder
and here is the code:
```java
public com.codename1.ui.Component create_bcVideo() {
return new com.codename1.ui.BrowserComponent() {
@Override
protected Dimension calcPreferredSize() {
int w = Display.getInstance().getDisplayWidth();
int h = (int) (Display.getInstance().getDisplayHeight() * 0.4);
return new Dimension(w, h);
}
};
}
```
And here is the code to show the embedded video in the component:
```java
private void loadVideo() {
String page = "<html style='background-color:#e7e8e9;'><body><iframe
style='width:100%; height:90%; display:block;' src='" + linkVideo + "'
frameborder='0' allow='autoplay; encrypted-media' webkitallowfullscreen
mozallowfullscreen allowfullscreen></iframe></body></html>";
((com.codename1.ui.BrowserComponent)gui_bcVideo).setPage(page, null);
}
```
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/da2569cb-dcbf-4185-8fec-78ca05378eb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.