您正在尝试在视频视图中播放来自我的网络服务器的视频时,该代码与我之前的服务器完美配合,但是在尝试从新服务器播放时,它给了我一个无内容提供商错误。我不知道问题是什么我看起来不受限制,因为如果我在浏览器中键入目的地,则允许我下载
final VideoView videoview = (VideoView) findViewById(R.id.profileVid);
String ondPath = "http://www.gogodis.comxa.com/img/1/profileVid/SampleVideo.3gp";
String newPath = "http://www.reelychat.com/img/1/profileVid/SampleVideo.3gp";
try {
// Start the MediaController
MediaController mediacontroller = new MediaController(ProfileN.this);
mediacontroller.setAnchorView(videoview);
// Get the URL from String VideoURL
Uri video = Uri.parse(newPath);
videoview.setMediaController(mediacontroller);
videoview.setVideoURI(video);
} catch (Exception e) {
Log.e("Error", e.getMessage());
e.printStackTrace();
}
videoview.requestFocus();
videoview.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
// Close the progress bar and play the video
public void onPrepared(MediaPlayer mp) {
videoview.start();
}
});
这是logcast的副本
07-26 15:13:36.097 27979-27979/com.reallyChat D/MediaPlayer: setDataSource IOException happend :
java.io.FileNotFoundException: No content provider: http://www.reelychat.com/img/1/profileVid/SampleVideo.3gp
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:713)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:617)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:954)
at android.widget.VideoView.openVideo(VideoView.java:236)
at android.widget.VideoView.setVideoURI(VideoView.java:198)
at android.widget.VideoView.setVideoURI(VideoView.java:188)
at com.really_chat.ProfileN$DownloadWebpageTask.onPostExecute(ProfileN.java:722)
at com.really_chat.ProfileN$DownloadWebpageTask.onPostExecute(ProfileN.java:628)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5283)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
请帮助