Changes due to CR

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2018-06-27 11:46:48 +02:00 committed by AndyScherzinger
parent f7039115be
commit 5b1a011bff
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 17 additions and 20 deletions

View file

@ -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();
}

View file

@ -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);
}
}
}