Issue 502180 in chromium: On Lollipop, the full screen video view is transparent on webview.

26 views
Skip to first unread message

chro...@googlecode.com

unread,
Jun 19, 2015, 5:24:48 AM6/19/15
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: OS-Android Pri-2

New issue 502180 by yeni0...@gmail.com: On Lollipop, the full screen video
view is transparent on webview.
https://code.google.com/p/chromium/issues/detail?id=502180

Device name: Samsung Galaxy note4

From "Settings > About Chrome"
Application version: 43.0.2357.93
OS: Lollipop

URLs (if applicable):
http://milk.soribada.com/mobile/milkEvent/?uid=F335EF26F46A58CCF7EF804616226763&opt=5

Behavior in Android Browser (if applicable):


What steps will reproduce the problem?
1. Loaded a url which has a youtube video on webview.
2. Set The webview activity theme as transparent.
3. When the video is paused, click full screen button at the bottom right
of video view.


What is the expected result?
When I checked it on KitKat with same apk, black screen was showing. It
might be normal operation.


What happens instead?
The background color of the video surface view is transparent in case of
switching to full screen view when the video is paused on webview.
So, an activity stacked behind is appeared through the video surface view.
This issue just occurs on Lollipop OS.


[Sample code]

--MainActivity.java-----------------------------------------------------------------------
package com.example.webviewtestactivity;

import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;


public class MainActivity extends Activity {

private WebView mWebView;

private View mCustomView;

FullscreenableChromeClient mChoromeClient;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);
mWebView = (WebView) findViewById(R.id.notice_webview);

mWebView.setHorizontalScrollBarEnabled(false);
mWebView.getSettings().setTextZoom(100);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new WebViewClient());

mChoromeClient = new FullscreenableChromeClient();
mWebView.setWebChromeClient(mChoromeClient);


mWebView.loadUrl("http://milk.soribada.com/mobile/milkEvent/?uid=F335EF26F46A58CCF7EF804616226763&opt=5");
}

public class FullscreenableChromeClient extends WebChromeClient {
private Activity mActivity = MainActivity.this;

private WebChromeClient.CustomViewCallback mCustomViewCallback;

private FrameLayout mFullscreenContainer;

private final FrameLayout.LayoutParams COVER_SCREEN_PARAMS = new
FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);

@Override
public void onShowCustomView(View view,
WebChromeClient.CustomViewCallback callback) {
if (mCustomView != null) {
callback.onCustomViewHidden();
return;
}


setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
FrameLayout decor = (FrameLayout)
mActivity.getWindow().getDecorView();
mFullscreenContainer = new FullscreenHolder(mActivity);
mFullscreenContainer.addView(view, COVER_SCREEN_PARAMS);
decor.addView(mFullscreenContainer, COVER_SCREEN_PARAMS);
mCustomView = view;
setFullscreen(true);
mCustomViewCallback = callback;

super.onShowCustomView(view, callback);
}

@Override
public void onHideCustomView() {
if (mCustomView == null) {
return;
}


setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
setFullscreen(false);
FrameLayout decor = (FrameLayout)
mActivity.getWindow().getDecorView();
decor.removeView(mFullscreenContainer);
mFullscreenContainer = null;
mCustomView = null;
mCustomViewCallback.onCustomViewHidden();
}

private void setFullscreen(boolean enabled) {
Window win = mActivity.getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();
final int bits = WindowManager.LayoutParams.FLAG_FULLSCREEN;
if (enabled) {
winParams.flags |= bits;
} else {
winParams.flags &= ~bits;
if (mCustomView != null) {

mCustomView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
}
win.setAttributes(winParams);
}
}

private static class FullscreenHolder extends FrameLayout {
public FullscreenHolder(Context ctx) {
super(ctx);

setBackgroundColor(ctx.getResources().getColor(android.R.color.black));
}

@Override
public boolean onTouchEvent(MotionEvent evt) {
return true;
}
}
}

--Manifest.xml-------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.webviewtestactivity"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|uiMode|
orientation|screenSize"
android:theme="@style/AppTheme.Transparent"
android:launchMode="singleTop"
android:hardwareAccelerated="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

--activity_main.xml---------------------------------------------------------------------------------
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<WebView
android:id="@+id/notice_webview"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</WebView>

</RelativeLayout>

--styles.xml--------------------------------------------------------------------------------------
<resources>

<!--
Base application theme, dependent on API level. This theme is
replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular
API-level can go here. -->
</style>

<style name="AppTheme.Transparent" parent="AppTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">false</item>
</style>

</resources>




--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Jun 22, 2015, 7:03:26 PM6/22/15
to chromi...@chromium.org
Updates:
Status: Available
Owner: to...@chromium.org

Comment #2 on issue 502180 by mnag...@chromium.org: On Lollipop, the full
screen video view is transparent on webview.
https://code.google.com/p/chromium/issues/detail?id=502180

Confirmed. If you pause embedded video and then go fullscreen, then you see
video controls displayed on top of whatever your desktop looked like. Only
after you resume playing, the video occurs.

torne@: Please assign appropriately.

Attachments:
Screenshot_2015-06-22-15-51-24.png 1.6 MB

chro...@googlecode.com

unread,
Jun 23, 2015, 10:16:39 AM6/23/15
to chromi...@chromium.org
Updates:
Status: Assigned
Owner: paulmil...@chromium.org

Comment #3 on issue 502180 by to...@chromium.org: On Lollipop, the full
screen video view is transparent on webview.
https://code.google.com/p/chromium/issues/detail?id=502180

Paul, mind taking a look at this? igsolla@ did a lot of the
video/fullscreen view support and he isn't here any more.

chro...@googlecode.com

unread,
Jul 1, 2015, 9:24:40 PM7/1/15
to chromi...@chromium.org

Comment #4 on issue 502180 by jihyun...@gmail.com: On Lollipop, the full
screen video view is transparent on webview.
https://code.google.com/p/chromium/issues/detail?id=502180

I am wondering how to handle this issue.
Could you let me know how I can solve this issue?

chro...@googlecode.com

unread,
Aug 11, 2015, 3:15:19 AM8/11/15
to chromi...@chromium.org

Comment #5 on issue 502180 by yeni0...@gmail.com: On Lollipop, the full
screen video view is transparent on webview.
https://code.google.com/p/chromium/issues/detail?id=502180

Dear All,
Please check and let me know when this issue could be solved.

chro...@googlecode.com

unread,
Aug 11, 2015, 12:18:10 PM8/11/15
to chromi...@chromium.org

Comment #6 on issue 502180 by paulmil...@chromium.org: On Lollipop, the
full screen video view is transparent on webview.
https://code.google.com/p/chromium/issues/detail?id=502180

There is no ETA right now.

chro...@googlecode.com

unread,
Jan 8, 2016, 1:43:31 AM1/8/16
to chromi...@chromium.org

Comment #7 on issue 502180 by dame...@gmail.com: On Lollipop, the full
screen video view is transparent on webview.
https://code.google.com/p/chromium/issues/detail?id=502180

I don`t know how to deal with it.But the view to show video is different
between 4.4 and 5.0,they are VideoView and SurfaceView.So the show is
different.If you have resolved it,please tell me,thank you!

chro...@googlecode.com

unread,
Jan 8, 2016, 1:08:06 PM1/8/16
to chromi...@chromium.org

Comment #8 on issue 502180 by paulmil...@chromium.org: On Lollipop, the
full screen video view is transparent on webview.
https://code.google.com/p/chromium/issues/detail?id=502180

I have no new information right now.
Reply all
Reply to author
Forward
0 new messages