Media
video.setVideoPath(clip.getAbsolutePath());
ctlr=new MediaController(this);
ctlr.setMediaPlayer(video);
video.setMediaController(ctlr);
video.requestFocus();
video.start();
}
}
}
Here, we simply configure the VideoView, including the MediaController to
give us buttons to control playback of the video. At the end, we call start(),
to begin playback automatically.
And, as always, when we add an activity to our project, we need to add it to
AndroidManifest.xml, so add the following element alongside the
others:
Step #3: Launch the Helpcast from the Menu
Finally, we need to integrate HelpCast into Patchy overall, so users can
display the help video. As we have done in previous tutorials, we will
accomplish this by extending the option menu with another menu item.
First, add the following- to Patchy/res/menu/option.xml:
android:title="Help"
android:icon="@drawable/ic_menu_help"
/>
You will also need a suitable menu icon, such as the ic_menu_help.png image
from the Android SDK.
Then, update onOptionsItemSelected() in Patchy to launch HelpCast when
our item is selected:
247
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
video.setVideoPath(clip.getAbsolutePath());
ctlr=new MediaController(this);
ctlr.setMediaPlayer(video);
video.setMediaController(ctlr);
video.requestFocus();
video.start();
}
}
}
Here, we simply configure the VideoView, including the MediaController to
give us buttons to control playback of the video. At the end, we call start(),
to begin playback automatically.
And, as always, when we add an activity to our project, we need to add it to
AndroidManifest.xml, so add the following
others:
Step #3: Launch the Helpcast from the Menu
Finally, we need to integrate HelpCast into Patchy overall, so users can
display the help video. As we have done in previous tutorials, we will
accomplish this by extending the option menu with another menu item.
First, add the following
android:icon="@drawable/ic_menu_help"
/>
You will also need a suitable menu icon, such as the ic_menu_help.png image
from the Android SDK.
Then, update onOptionsItemSelected() in Patchy to launch HelpCast when
our item is selected:
247
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
