0

インテントを使用して webview からビデオを再生したいのですが、再生中にエラーが発生します。私は次のコードを使用します。

myweb.loadUrl("http://www.clipcanvas.com/a/video-clip-downloads/");

public boolean shouldOverrideUrlLoading(WebView view, String url) {

    if(url.endsWith(".mp4")){
        Intent i = new Intent(Intent.ACTION_VIEW);
        i.setDataAndType(Uri.parse(url),"video/*");
        view.getContext().startActivity(i); //warning no error handling will cause force close if no media player on phone.
        return true;
    }
    else return false;
}

しかし、プレーヤーを選択した後、次のプロセスの画像が表示されます。 ここに画像の説明を入力 ここに画像の説明を入力 ここに画像の説明を入力

4

0 に答える 0