1
저는 웹 뷰에서 소리가 들리지 않는 문제가 있습니다. 안드로이드의 기본 브라우저에서 사운드가 작동 중입니다.Webview에서 소리가 들리지 않습니다.
소리는 플래시입니다. 당신이보고 싶은 경우
, 당신은 열 수 있습니다 http://www.colourmonics.de/android/android16
여기 내 스크립트입니다 :
package C.K;
import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.WebChromeClient;
public class ColourmonicsKeyboardActivity extends Activity {
/** Called when the activity is first created. */
WebView mWebView;
@Override
public void onCreate(Bundle savedInstanceState)
{ super.onCreate(savedInstanceState);
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
setContentView(R.layout.main);
if (savedInstanceState != null){
((WebView)findViewById(R.id.webview)).restoreState(savedInstanceState);
} else {
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
mWebView.setWebChromeClient(new WebChromeClient());
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.loadUrl("http://www.colourmonics.de/android/android16");
}
}
private AudioManager audio;
protected void onSaveInstanceState(Bundle outState) {
mWebView.saveState(outState);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
audio.adjustStreamVolume(AudioManager.STREAM_MUSIC,
AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI);
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
audio.adjustStreamVolume(AudioManager.STREAM_MUSIC,
AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI);
return true;
default:
return false;
}
}
}
내가 시뮬 문제가 있었다