hiiビデオビューでビデオ再生を試みましたが、ビデオを再生しましたが、mediacontrollerが以下のコードを機能していません。フラグメントを使用しました。
public class ItemDetailFragment extends Fragment {
public static final String ARG_ITEM_ID = "item_id";
private DummyContent.DummyItem mItem;
public ItemDetailFragment() {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments().containsKey(ARG_ITEM_ID)) {
// Load the dummy content specified by the fragment
// arguments. In a real-world scenario, use a Loader
// to load content from a content provider.
mItem = DummyContent.ITEM_MAP.get(getArguments().getString(
ARG_ITEM_ID));
Log.v("log_tag","mItem ::; "+ mItem);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_item_detail,
container, false);
VideoView vcVideoView;
// Show the dummy content as text in a TextView.
if (mItem != null) {
/*((TextView) rootView.findViewById(R.id.item_detail))
.setText(mItem.url);*/
vcVideoView=((VideoView) rootView.findViewById(R.id.videoView));
// .setVideoPath(mItem.url);
MediaController mc = new MediaController(this);
//vcVideoView.setMediaController(new MediaController());
//vcVideoView.setMediaController(mc);
Uri uri = Uri.parse(mItem.url);
vcVideoView.setVideoURI(uri);
vcVideoView.setSoundEffectsEnabled(true);
vcVideoView.requestFocus();
vcVideoView.start();
}
return rootView;
}
}
エラーはThe constructor MediaController(ItemDetailFragment) is undefined
!! それを解決する方法。助けてください!!!