안녕하세요 초보개발자입니다.
웹뷰로 작업중인데요 유투브 동영상이 소리만 나고 동영상이 나오질않네요..
검색을 해봣는데도 제소스엔 적용이 안됩니다..ㅜㅜ
머가 잘못된건가용..??소스보여드립니다.
@Override
public void Open(WindowManager.LayoutParams params , WindowManager wm) {
pause = true;
mWebview.setFocusableInTouchMode(true);
mWebview.requestFocus(View.FOCUS_DOWN);
mWebview.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_UP:
if (!v.hasFocus()) {
v.requestFocus();
}
break;
}
return false;
}
});
mWebview.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
view.loadUrl(url);
Log.d("ErrorLog", url);
murl = url;
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
Log.d("ErrorLog", "URL ==== " + url);
Bar.setVisibility(View.INVISIBLE);
edittext.setText(mWebview.getUrl());
if(view.getProgress() == 100){
bwebviewflag = true;
bookmarksearch();
Log.d("ErrorLog", "progress = " + view.getProgress());
final View view1 = view;
new Thread (new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
try{
Thread.sleep(1000);
if(screenshotType){
defaultScreenshot();
ScreenShot(view1);
}
}catch (Exception e) {
// TODO: handle exception
Log.d("ErrorLog", "LoginActivity : oncreate run =" + e.toString());
}
}
}).start();
}
super.onPageFinished(view, url);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
Bar.setVisibility(View.VISIBLE);
}
});
mWebview.setWebChromeClient(new WebChromeClient(){
@Override
public void onProgressChanged(WebView view , int newProgress) {
Bar.setProgress(newProgress);
}
});
//
mWebview.getSettings().setJavaScriptEnabled(true);
mWebview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
mWebview.getSettings().setBuiltInZoomControls(true);
mWebview.getSettings().setPluginState(PluginState.ON);
mWebview.getSettings().setSupportMultipleWindows(false);
mWebview.getSettings().setSupportZoom(true);
// mWebview.getSettings().setBlockNetworkImage(false);
mWebview.getSettings().setLoadsImagesAutomatically(true);
mWebview.getSettings().setUseWideViewPort(true);
mWebview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
mWebview.getSettings().setDomStorageEnabled(true);
mWebview.setClickable(true);
mWebview.setFocusable(true);
mWebview.setFocusableInTouchMode(true);
mWebview.setLongClickable(true);
mWebview.getSettings().setGeolocationEnabled(true);
mWebview.getSettings().setDatabaseEnabled(true);
mWebview.loadUrl(murl);
edittext.setText(murl);
wm.addView(WebLayout, params);
}