1. Are you ready for the Galaxy S20? Here is everything we know so far!

Auto play video in webview

Discussion in 'Android Devices' started by aprateek, Sep 11, 2018.

  1. aprateek

    aprateek Lurker
    Thread Starter

    I am displaying a youtube link in a webview. I want to autoplay the link.
    Problem is that, After opening a link i have to click on video then video is playing but i want that video should be play automatically.

    Thanks in Advance.

    My Code :
    -------------------------------------------------------------------------------------------------------------------
    myWebView.setWebViewClient(new WebViewClient() {
    @override
    public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
    view.loadUrl(request.getUrl().toString());
    return true;
    }
    }
    myWebView.getSettings().setJavaScriptEnabled(true);
    myWebView.getSettings().setMediaPlaybackRequiresUserGesture(false);

    myWebView.loadUrl("");
    -------------------------------------------------------------------------------------------------------------------

    Tested on Devices :
    1) Amlogic Android Media Boxes(Android 6.0.1) -> Not working.
    2) Nexus 5 (Android 6.0) -> Working.
     


Amlogic MXQ Pro Forum

Features and specs are not yet known.

unknown
Release Date
0
Reviews
Loading...

Share This Page

Loading...