-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
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;
* Trying to get an instance with NULL {@link OCFile} or ownCloud {@link Account} values will produce an {@link IllegalStateException}.
*
* By now, if the {@link OCFile} passed is not downloaded, an {@link IllegalStateException} is generated on instantiation too.
- *
- * @author David A. Velasco
*/
public class PreviewMediaFragment extends FileFragment implements
OnTouchListener {
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()));
}