Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8691775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:11:30+00:00 2026-06-13T00:11:30+00:00

I have the following code. It successfully stream the video from YouTube. But when

  • 0

I have the following code. It successfully stream the video from YouTube. But when the video ended. It cannot be played again, not even if I quit and re-enter the app. It always shows the loading page then jump to suggested video immediately.

public class HdPlayer extends CustomView {
Button share_btn;
DisplaySize mDisplaySize;
String youtubeLink = null;
String thumbnailLink, description, VideoId, viewCount, date = null;
String title = null;
WebView webview;
String duration = null;

DbAdapter db;

/** Called when the activity is first created. */
@SuppressLint("SetJavaScriptEnabled")
@Override
public void onCreate(Bundle savedInstanceState) {
    // Remove notification bar
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.hd_player);
    db = new DbAdapter(this);

    titlebar_title.setText("Playing");
    titlebar_icon.setImageResource(R.drawable.titlebar_play);
    Bundle bundle = this.getIntent().getExtras();
    youtubeLink = bundle.getString("youtubeLink");


    webview = (WebView) findViewById(R.id.web_view_player);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.getSettings().setPluginState(PluginState.ON);
    webview.getSettings().setPluginsEnabled(true);
    // webview.getSettings().setLoadWithOverviewMode(true);// completely zoomed out
    // webview.getSettings().setUseWideViewPort(true);
    webview.getTouchables();

    webview.setBackgroundColor(Color.parseColor("#00000000"));
    mDisplaySize = new DisplaySize(this);

    Display display = getWindowManager().getDefaultDisplay();
    int[] widthHeight = new int[2];
    widthHeight = mDisplaySize.getDisplaySize(display);
    int width = widthHeight[0];
    int height = widthHeight[1];
    Log.i("iframe", " before iframe");
    String emdLink = "http://www.youtube.com/embed/" + VideoId;
    Log.i("iframe", " before loadData, youtubeLink: " + emdLink);

    LayoutParams lp = new RelativeLayout.LayoutParams(width,
            (width / 4) * 3);
    lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
    webview.setLayoutParams(lp);
    webview.setWebChromeClient(new WebChromeClient());
    webview.loadUrl(emdLink);


}

@Override
public void onPause() {
    super.onPause();

    try {
        Log.i("in onpause", "onpause try" );
        Class.forName("android.webkit.WebView")
                .getMethod("onPause", (Class[]) null)
                .invoke(webview, (Object[]) null);

    } catch (ClassNotFoundException cnfe) {
    } catch (NoSuchMethodException nsme) {
    } catch (InvocationTargetException ite) {
    } catch (IllegalAccessException iae) {
    }
    webview.clearCache(true);
    webview.clearHistory();
    webview.destroy();
}




}

It reports error: dequeueBuffer: SurfaceComposer::createGraphicBuffer failed

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:11:31+00:00Added an answer on June 13, 2026 at 12:11 am

    The following code works fine for me. Try to add this
    webView.setWebViewClient(new WebViewClient());

    webView.setWebChromeClient(new WebChromeClient(){
    
    });
    webView.setWebViewClient(new WebViewClient());
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setPluginsEnabled(true);
    webView.getTouchables();
    webView.setBackgroundColor(Color.parseColor("#00000000"));
    String emdLink = "http://www.youtube.com/embed/" + "hPUGNCIozp0";
    webView.loadUrl(emdLink);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that I expect to run successfully to completion but
I have following code which successfully sent email using Gmail address. But when i
I need to sort nodes in xml. I have the following code which successfully
I have following code for loading image from url in xml parsing endElement method
I have the following code in child window which is working but what I
I have the following code: try { mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPEndPoint
so i have the following code opening an input stream and collecting the information
I have the following code to perform a dynamic query of JOINED tables but
I have following code which is not working on sencha touch 2, is there
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.