我写这篇文章是为了看一个安卓片段中的视频。
public class Video_fragment extends Fragment{
private View rootView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.video_layout, container, false);
return rootView;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Activity my_activity = this.getActivity();
VideoView vid1 = (VideoView) getView().findViewById(R.id.videoView);
Uri path = Uri.parse("https://pdlvimeocdn-a.akamaihd.net/70364/541/376889773.mp4?token2=1435321048_5e268d54554862ae1b8096d54bab15e8&aksessionid=69a5f78c453bf170");
vid1.setVideoURI(path);
vid1.setMediaController(new MediaController(my_activity));
vid1.start();
}
}
但我得到了这个错误:
06-29 14:20:55.724 8979-8979/com.example.aviad.uefa E/ExtMediaPlayer-JNI﹕ QCMediaPlayer could not be located....
06-29 14:20:55.724 8979-8979/com.example.aviad.uefa E/MediaPlayer-JNI﹕ QCMediaPlayer mediaplayer NOT present
06-29 14:20:55.734 8979-8979/com.example.aviad.uefa E/MediaPlayer[Native]﹕ Unable to create media player
试图寻找可能有所帮助的东西,但我找不到任何东西。 我该如何解决?