我在RecyclerView中有几个VideoView . 我想将我的网络服务器中的视频加载到这些视图中 .
我收到以下错误:
W / MediaPlayer:无法打开http://giftube.kjdion.com/mp4/3.mp4:java.io.FileNotFoundException:没有内容提供商:http://giftube.kjdion.com/mp4/3.mp4
如果我点击VideoView,该应用程序也会立即崩溃 .
您可以清楚地看到它是否可以访问http://giftube.kjdion.com/mp4/3.mp4 .
我在我的清单上添加了INTERNET权限 .
这是我的适配器视图持有者的代码:
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
Scrape scrape = list.get(position);
holder.textTitle.setText(scrape.getTitle());
holder.videoView.setVideoURI(Uri.parse(Global.url+"/mp4/"+scrape.getId()+".mp4"));
}
public class ViewHolder extends RecyclerView.ViewHolder {
public TextView textTitle;
public VideoView videoView;
public ViewHolder(View itemView) {
super(itemView);
textTitle = itemView.findViewById(R.id.main_title);
videoView = itemView.findViewById(R.id.main_video);
}
}
为什么这不起作用?