0
我想播放從VideoView中的WebView傳遞的視頻。它工作,除了VideoView不想讀取它。我不斷收到錯誤:HTML5視頻Android VideoView
「對不起,此視頻無法播放。」
下面是VideoView代碼:
public class VideoHandler extends Activity {
WebView myWebView;
VideoView myVideoView;
WebChromeClient chromeClient;
WebViewClient wvClient;
Intent in;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.video_player);
myVideoView = (VideoView) findViewById(R.id.videoview);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(myVideoView);
String video = (MNWVMainPage.myWebView.getUrl());
myVideoView.setMediaController(mediaController);
myVideoView.setVideoPath(video);
myVideoView.start();
myVideoView.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
mp.stop();
mp.release();
setContentView(R.layout.mnwv_main);
}
});
}
}
爲什麼慣於此負載的視頻?
一些你管視頻也顯示這種警報,請檢查視頻是否可播放或檢查它是否在默認瀏覽器中播放。 – Karthi