mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Changes due to CR
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
f7039115be
commit
5b1a011bff
2 changed files with 17 additions and 20 deletions
|
@ -352,28 +352,25 @@ public class FileOperationsHelper {
|
|||
public void streamMediaFile(OCFile file) {
|
||||
mFileActivity.showLoadingDialog(mFileActivity.getString(R.string.wait_a_moment));
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Account account = AccountUtils.getCurrentOwnCloudAccount(mFileActivity);
|
||||
StreamMediaFileOperation sfo = new StreamMediaFileOperation(file.getLocalId());
|
||||
RemoteOperationResult result = sfo.execute(account, mFileActivity);
|
||||
new Thread(() -> {
|
||||
Account account = AccountUtils.getCurrentOwnCloudAccount(mFileActivity);
|
||||
StreamMediaFileOperation sfo = new StreamMediaFileOperation(file.getLocalId());
|
||||
RemoteOperationResult result = sfo.execute(account, mFileActivity);
|
||||
|
||||
mFileActivity.dismissLoadingDialog();
|
||||
mFileActivity.dismissLoadingDialog();
|
||||
|
||||
if (!result.isSuccess()) {
|
||||
DisplayUtils.showSnackMessage(mFileActivity, R.string.stream_not_possible_headline);
|
||||
return;
|
||||
}
|
||||
|
||||
Intent openFileWithIntent = new Intent(Intent.ACTION_VIEW);
|
||||
Uri uri = Uri.parse((String) result.getData().get(0));
|
||||
|
||||
openFileWithIntent.setDataAndType(uri, file.getMimetype());
|
||||
|
||||
mFileActivity.startActivity(Intent.createChooser(openFileWithIntent,
|
||||
mFileActivity.getString(R.string.stream)));
|
||||
if (!result.isSuccess()) {
|
||||
DisplayUtils.showSnackMessage(mFileActivity, R.string.stream_not_possible_headline);
|
||||
return;
|
||||
}
|
||||
|
||||
Intent openFileWithIntent = new Intent(Intent.ACTION_VIEW);
|
||||
Uri uri = Uri.parse((String) result.getData().get(0));
|
||||
|
||||
openFileWithIntent.setDataAndType(uri, file.getMimetype());
|
||||
|
||||
mFileActivity.startActivity(Intent.createChooser(openFileWithIntent,
|
||||
mFileActivity.getString(R.string.stream)));
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
|
|
@ -512,7 +512,7 @@ public class PreviewMediaFragment extends FileFragment implements
|
|||
|
||||
new LoadStreamUrl(this, client).execute(getFile().getLocalId());
|
||||
} catch (Exception e) {
|
||||
Log_OC.e(TAG, "Loading stream url not possible: " + e.getMessage());
|
||||
Log_OC.e(TAG, "Loading stream url not possible: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue