X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/1e68dccd8b3efa28e1ebc5d12d5c9ce4a3260a9f..ff82b51e49f40155e7c340090f5ee759af2bf3ad:/src/com/owncloud/android/ui/preview/PreviewVideoActivity.java diff --git a/src/com/owncloud/android/ui/preview/PreviewVideoActivity.java b/src/com/owncloud/android/ui/preview/PreviewVideoActivity.java index 9e6a2803..938d52d4 100644 --- a/src/com/owncloud/android/ui/preview/PreviewVideoActivity.java +++ b/src/com/owncloud/android/ui/preview/PreviewVideoActivity.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, @@ -18,11 +21,9 @@ package com.owncloud.android.ui.preview; import com.owncloud.android.R; -import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.media.MediaService; import com.owncloud.android.ui.activity.FileActivity; -import com.owncloud.android.utils.Log_OC; import android.accounts.Account; import android.app.AlertDialog; @@ -37,8 +38,9 @@ import android.os.Bundle; import android.widget.MediaController; import android.widget.VideoView; -import com.owncloud.android.lib.accounts.AccountUtils; -import com.owncloud.android.lib.accounts.AccountUtils.AccountNotFoundException; +import com.owncloud.android.lib.common.accounts.AccountUtils; +import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException; +import com.owncloud.android.lib.common.utils.Log_OC; /** * Activity implementing a basic video player. @@ -46,9 +48,7 @@ import com.owncloud.android.lib.accounts.AccountUtils.AccountNotFoundException; * Used as an utility to preview video files contained in an ownCloud account. * * Currently, it always plays in landscape mode, full screen. When the playback ends, - * the activity is finished. - * - * @author David A. Velasco + * the activity is finished. */ public class PreviewVideoActivity extends FileActivity implements OnCompletionListener, OnPreparedListener, OnErrorListener { @@ -60,8 +60,6 @@ public class PreviewVideoActivity extends FileActivity implements OnCompletionLi private static final String TAG = PreviewVideoActivity.class.getSimpleName(); - private FileDataStorageManager mStorageManager; - private int mSavedPlaybackPosition; // in the unit time handled by MediaPlayer.getCurrentPosition() private boolean mAutoplay; // when 'true', the playback starts immediately with the activity private VideoView mVideoPlayer; // view to play the file; both performs and show the playback @@ -191,9 +189,9 @@ public class PreviewVideoActivity extends FileActivity implements OnCompletionLi return true; } - @Override protected void onAccountSet(boolean stateWasRecovered) { + super.onAccountSet(stateWasRecovered); if (getAccount() != null) { OCFile file = getFile(); /// Validate handled file (first image to preview) @@ -203,8 +201,7 @@ public class PreviewVideoActivity extends FileActivity implements OnCompletionLi if (!file.isVideo()) { throw new IllegalArgumentException("Non-video file passed as argument"); } - mStorageManager = new FileDataStorageManager(getAccount(), getContentResolver()); - file = mStorageManager.getFileById(file.getFileId()); + file = getStorageManager().getFileById(file.getFileId()); if (file != null) { if (file.isDown()) { mVideoPlayer.setVideoPath(file.getStoragePath()); @@ -230,7 +227,6 @@ public class PreviewVideoActivity extends FileActivity implements OnCompletionLi finish(); } } else { - Log_OC.wtf(TAG, "onAccountChanged was called with NULL account associated!"); finish(); } }