cprcrack / VideoEnabledWebView

Android's WebView and WebChromeClient class extensions that enable fully working HTML5 video support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

blank screen and html video support

1reldi opened this issue · comments

i had a blank screen after i followed the example here . i than noticed that the problem was in "activity_example" where the full screen view was blocking the view , so i added background color transparent so i made this change in "activity_example" :
`

    <!-- View that will be shown while the fullscreen video loads. For example you could include
    a "Loading..." message. However, in this particular example this view is actually defined in
    view_loading_video.xml and inflated programmatically in ExampleActivity.java. The reason for
    this is to keep the main layout (this file) cleaner. -->
    <!-- <View
        android:id="@+id/videoLoading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:visibility="invisible" /> -->

</RelativeLayout>`

also i had a problem with html5 videos, they couldnt be played ... this happens when video is in a div, so you should add these lines in your "ExampleActivity.java" before you call "webView.loadUrl("m.youtube.com")":
webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setMediaPlaybackRequiresUserGesture(false); webView.getSettings().setDomStorageEnabled(true); webView.getSettings().setAppCacheEnabled(true); webView.getSettings().setAppCachePath(getApplicationContext().getFilesDir().getAbsolutePath() + "/cache"); webView.getSettings().setDatabaseEnabled(true); webView.getSettings().setDatabasePath(getApplicationContext().getFilesDir().getAbsolutePath() + "/databases"); webView.loadUrl("m.youtube.com");
i hope this helps anyone with those problems