import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
+import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileMenuFilter;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.media.MediaControlView;
import com.owncloud.android.media.MediaService;
import com.owncloud.android.media.MediaServiceBinder;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
import com.owncloud.android.ui.fragment.FileFragment;
-import com.owncloud.android.utils.Log_OC;
/**
}
} else {
- setFile((OCFile)savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_FILE));
+ file = (OCFile)savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_FILE);
+ setFile(file);
mAccount = savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_ACCOUNT);
mSavedPlaybackPosition =
savedInstanceState.getInt(PreviewMediaFragment.EXTRA_PLAY_POSITION);
item.setVisible(false);
item.setEnabled(false);
}
+
+ // additional restriction for this fragment
+ item = menu.findItem(R.id.action_move);
+ if (item != null) {
+ item.setVisible(false);
+ item.setEnabled(false);
+ }
}
}
case R.id.action_send_file: {
sendFile();
+ return true;
}
case R.id.action_sync_file: {
mContainerActivity.getFileOperationsHelper().syncFile(getFile());
mVideoPreview.setOnErrorListener(mVideoHelper);
}
+ @SuppressWarnings("static-access")
private void playVideo() {
// create and prepare control panel for the user
mMediaController.setMediaPlayer(mVideoPreview);
// load the video file in the video player ;
// when done, VideoHelper#onPrepared() will be called
- mVideoPreview.setVideoPath(getFile().getStoragePath());
+ Uri uri = Uri.parse(getFile().getStoragePath());
+ mVideoPreview.setVideoPath(uri.encode(getFile().getStoragePath()));
}