X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/2ef886af316609c2e4a1fe5f2ee32345a8008e33..afaa2879d192be067cae523b51dad75d89a6c6cb:/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java diff --git a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java index ea412ced..d82faa59 100644 --- a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java @@ -1,5 +1,8 @@ -/* 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, @@ -29,6 +32,7 @@ import android.media.MediaPlayer; 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; @@ -63,8 +67,6 @@ import com.owncloud.android.ui.fragment.FileFragment; * 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 { @@ -372,13 +374,15 @@ public class PreviewMediaFragment extends FileFragment implements 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())); }