projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wip
[pub/Android/ownCloud.git]
/
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
ec6a8cf
..
4ba5326
100644
(file)
--- 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,
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@
-21,13
+24,11
@@
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.media.MediaService;
import com.owncloud.android.ui.activity.FileActivity;
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.accounts.Account;
-import android.app.AlertDialog;
+import android.
support.v7.
app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface;
import android.content.Intent;
-import android.content.res.Configuration;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
@@
-39,6
+40,7
@@
import android.widget.VideoView;
import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.common.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.
/**
* Activity implementing a basic video player.
@@
-46,9
+48,7
@@
import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundExce
* 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,
* 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 {
*/
public class PreviewVideoActivity extends FileActivity implements OnCompletionListener, OnPreparedListener, OnErrorListener {
@@
-190,11
+190,6
@@
public class PreviewVideoActivity extends FileActivity implements OnCompletionLi
}
@Override
}
@Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- }
-
- @Override
protected void onAccountSet(boolean stateWasRecovered) {
super.onAccountSet(stateWasRecovered);
if (getAccount() != null) {
protected void onAccountSet(boolean stateWasRecovered) {
super.onAccountSet(stateWasRecovered);
if (getAccount() != null) {
@@
-214,12
+209,13
@@
public class PreviewVideoActivity extends FileActivity implements OnCompletionLi
} else {
// not working yet
String url;
} else {
// not working yet
String url;
- try {
- url = AccountUtils.constructFullURLForAccount(this, getAccount()) + file.getRemotePath();
+// try {
+// url = AccountUtils.constructFullURLForAccount(this, getAccount()) + file.getRemotePath();
+ url = PreviewMediaFragment.generateUrlWithCredentials(getAccount(), getApplicationContext(), getFile());
mVideoPlayer.setVideoURI(Uri.parse(url));
mVideoPlayer.setVideoURI(Uri.parse(url));
- } catch (AccountNotFoundException e) {
- onError(null, MediaService.OC_MEDIA_ERROR, R.string.media_err_no_account);
- }
+
//
} catch (AccountNotFoundException e) {
+
//
onError(null, MediaService.OC_MEDIA_ERROR, R.string.media_err_no_account);
+
//
}
}
// create and prepare control panel for the user
}
// create and prepare control panel for the user