Implement fast forward and rewind (trick-play mode)

Changing the playback rate is a single step.

Initiate trick play mode by setting the rate property for the MediaPlayer class to an allowed value.

Just to show how to set the rate, this example sets it using a dialog.

private void selectPlaybackRate() {
        PMPDemoApp.logger.i(LOG_TAG + "#selectPlaybackRate", "Displaying playback rate chooser dialog.");

        final String items[] = getAvailabeRatesArray();
        final int selectedRateIndex = getSelectedRateIndex();
        new AlertDialog.Builder(getActivity())
                .setTitle(R.string.PlayerControlRTDialogTitle)
                .setSingleChoiceItems(items, selectedRateIndex, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        MediaPlayerItem currentItem = _mediaPlayer.getCurrentItem();
                        Float desiredRate = currentItem.getAvailablePlaybackRates().get(whichButton);

                        // set rate
                        _mediaPlayer.setRate(desiredRate.floatValue());

                        // Dismiss dialog.
                        dialog.cancel();
                    }
                })
                .setNegativeButton(R.string.PlayerControlRTDialogCancel, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        // Just cancel the dialog.
                    }
                })
                .show();
    }