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

ၸိူင်း သုင်ၵေႃႈတေပိတ်းဢဝ်ႁႂ်ႈလႆႈ

 ၶႂ်ႈတူၺ်းမႆၢလႂ်ၵေႃႈ တဵၵ်းတီႈမႆၢၼၼ်ႉသေၸၼ်လူင်းသႂ်ႇၼႂ်းၽူင်းသေတူၺ်းၶႃႈလႄႈ မႆၢ (1)                 မႆၢ (5)           မႆၢ (8)         မႆၢ (11)    မႆၢ (2)                 မႆၢ (6)           မႆၢ (9)         မႆၢ (12)           မႆၢ (14) တွၼ််ႈသုတ်း မႆၢ (3)                 မႆၢ (7)           မႆၢ (10)       မႆၢ (13) မႆၢ (4)

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

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