현재 웹 사이트를 기반으로하는 Android 애플리케이션에서 작업하고 있습니다. iOS 응용 프로그램이 이미 존재하므로 유니 코드에 대한 일부 코드를 존중해야합니다.Android 웹보기에서 iframe 동영상이 전체 화면 모드로 전환되지 않습니다.
모든 것이 거의 완료되었지만 흥미로운 문제가 발견되었습니다. iframe 동영상 (Youtube, Dailymotion)이 포함 된 페이지의 webview (페이지가 표시되지 않아도 제어 할 수 없음)를 사용하면 ' 나는 플레이어의 버튼을 눌러도 전체 화면으로 이동하지 않습니다.
나는 이미 여기에서 발견 된 거의 모든 것을 시도했지만, 표시해야하는 페이지를 알고있는 앱만 참조합니다.
다음은 응용 프로그램의 webActivity 부분에 대한 코드입니다 : 어떤 도움
public class WebActivity extends Activity {
String targetURL = "";
String title = "";
WebView wv;
@Override
public void onResume() { super.onResume(); CookieSyncManager.getInstance().startSync(); }
@Override
public void onPause() { super.onPause(); CookieSyncManager.getInstance().stopSync(); }
/** Called when the activity is first created. */
@SuppressLint("SetJavaScriptEnabled")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_PROGRESS);
//getWindow().requestFeature(Window.FEATURE_NO_TITLE);
CookieSyncManager.createInstance(getApplicationContext());
CookieSyncManager.getInstance().startSync();
CookieManager.getInstance().setAcceptCookie(true);
/**
* TODO: WebView Cookie management.
* Right now, a cookie is hardcoded here into the WebView instead of getting it from the API called by HttpClient when retrieving the JSON.
* Need to make things cleaner.
*/
CookieManager.getInstance().setCookie("http://www.blabla.fr/mobile/","gbapi=1; Domain=.www.blabla.fr");
/**
* Get parameters
*/
Bundle b = getIntent().getExtras();
if(b != null)
{
targetURL = b.getString("url");
title = b.getString("title");
}
setTitle(title);
setContentView(R.layout.activity_webview);
wv = (WebView) findViewById(R.id.webview);
WebSettings wvSettings = wv.getSettings();
// WebView options
wvSettings.setDefaultTextEncodingName("utf-8");
wvSettings.setJavaScriptEnabled(true);
wvSettings.setPluginState(PluginState.ON);
wvSettings.setJavaScriptCanOpenWindowsAutomatically(true);
wvSettings.setBuiltInZoomControls(true);
final Activity activity = this;
wv.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
activity.setProgress(progress * 100);
}
});
wv.setWebViewClient(new WebViewClient() {
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(activity, "Oh snap! " + description, Toast.LENGTH_SHORT).show();
}
});
wv.loadUrl(targetURL);
}
}
감사합니다.
내가 몇 달이 코드에보고되지 않은 : 여기 당신처럼 또 다른 질문입니다
: 여기
그 기능입니다. 반쯤 완료된 수술과 남은 변수가 많습니다. ><이것을 정리할 시간. – MattC감사합니다. 코드를 약간 수정해야했지만 사용할 수있었습니다. – Pascal