cprcrack / VideoEnabledWebView

Android's WebView and WebChromeClient class extensions that enable fully working HTML5 video support
MIT License
1.05k stars 289 forks source link

Fullscreen landscape video does not fill screen #40

Open mtl3jx opened 6 years ago

mtl3jx commented 6 years ago

I have found this code extremely helpful, I was just wondering if you might know why I'm having this issue.

The activity my video enabled WebView is housed in is required to be in portrait mode. I want the full screen video layout to be in landscape. I tried "faking" this by rotating the container for the full screen video layout, however this gives me two issues.

  1. Rotated video does not fill the entire screen.
  2. The YouTube video player controls disappear.

Any ideas why this is happening / how to fix? Thanks!

<RelativeLayout
   android:id="@+id/videoLayout"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:rotation="90" />

31781924_10155676575017075_9085845766697648128_n

J3K commented 5 years ago

activityVideoView.addView(videoViewContainer, new ViewGroup.LayoutParams(100, 100);

You will find this in the VideoEnabledWebChromeClient.java.