Skip to main content

Webview နှင့် Videoview မှာ ဗီဒီယို အကျယ်ချဲ့ကြည့်လို့မရတဲ့ဗျဿနာ ‌ေြဖရှင်ူရန်ကုဒ်


Code 1
}

public class CustomWebClient extends WebChromeClient {
private View mCustomView;
private WebChromeClient.CustomViewCallback mCustomViewCallback;
protected FrameLayout frame;

// Initially mOriginalOrientation is set to Landscape
private int mOriginalOrientation = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
private int mOriginalSystemUiVisibility;

// Constructor for CustomWebClient
public CustomWebClient() {}

public Bitmap getDefaultVideoPoster() {
if (MainActivity.this == null) {
return null; }
return BitmapFactory.decodeResource(MainActivity.this.getApplicationContext().getResources(), 2130837573); }

public void onShowCustomView(View paramView, WebChromeClient.CustomViewCallback viewCallback) {
if (this.mCustomView != null) {
onHideCustomView();
return; }
this.mCustomView = paramView;
this.mOriginalSystemUiVisibility = MainActivity.this.getWindow().getDecorView().getSystemUiVisibility();
// When CustomView is shown screen orientation changes to mOriginalOrientation (Landscape).
MainActivity.this.setRequestedOrientation(this.mOriginalOrientation);
// After that mOriginalOrientation is set to portrait.
this.mOriginalOrientation = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
this.mCustomViewCallback = viewCallback; ((FrameLayout)MainActivity.this.getWindow().getDecorView()).addView(this.mCustomView, new FrameLayout.LayoutParams(-1, -1)); MainActivity.this.getWindow().getDecorView().setSystemUiVisibility(3846);
}

public void onHideCustomView() {
((FrameLayout)MainActivity.this.getWindow().getDecorView()).removeView(this.mCustomView);
this.mCustomView = null;
MainActivity.this.getWindow().getDecorView().setSystemUiVisibility(this.mOriginalSystemUiVisibility);
// When CustomView is hidden, screen orientation is set to mOriginalOrientation (portrait).
MainActivity.this.setRequestedOrientation(this.mOriginalOrientation);
// After that mOriginalOrientation is set to landscape.
this.mOriginalOrientation = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; this.mCustomViewCallback.onCustomViewHidden();
this.mCustomViewCallback = null;
}
}

{

Code 2
webview1.setWebChromeClient(new CustomWebClient());

Comments

Popular posts from this blog

ဢႅပ်းၸိူင်းပိၼ်ႇသဵင်တႆးဢၼ်မႂ်ႇ

မႂ်ႇသုင်ၶႃႈ ယွၼ်ႉၵွပ်ႈပိူဝ်ႈ ဢႅပ်းဢၼ်ၵဝ်ႇၸိူဝ်းၼႆႉ မီးပၼ်ႁႃ ၼိူဝ်လွင်ႈတၢင်ႇၸိူင်းမႂ်ႇ ဢမ်ႇလႆႈယဝ်ႉၶႃႈလႄႈ လႆႈၶိုၼ်းမေႁဵတ်းဢႅပ်းမႂ်ႇ။  ၼႂ်းဢၼ်မႂ်ႇၼႆႉတေႉ တေတၢင်ႇပၼ်ၸိူင်းၵႂႃႇတႃႇသေႇ ၵူၺ်းၵႃႈ တေလႆႈသႂ်ႇၵႃႈတူၺ်းၸိူင်း ငိုၼ်းမၢၼ်ႈ 3000 ပျႃးၶႃႈဢေႃႈ။ ၸၼ်ဢဝ်ဢႅပ်းတီႈလိၵ်ႈတႂ်ႈၼႆႉ https://www.mediafire.com/download/1ba18v6lp5xjjnu

ဢႅပ်းမႂ်ႇဢပ်ႉတဵၵ်ႉ

တႃႇတူၺ်းထီးဝီး၊ ၸိူင်းပိၼ်ႇသဵင်တႆး ၸၼ်ဢဝ်တီႈတႂ်ႈၼႆႉၶႃႈ https://play.google.com/store/apps/details?id=com.tvmov.tai