introduced 'original' as video quality and do not ignorer error
This commit is contained in:
parent
6ac1c00d00
commit
cfab0dbe1b
|
@ -50,7 +50,7 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
|
||||||
final String mimeType = MimeUtils.guessMimeTypeFromUriAndMime(mXmppConnectionService, uri, type);
|
final String mimeType = MimeUtils.guessMimeTypeFromUriAndMime(mXmppConnectionService, uri, type);
|
||||||
final int autoAcceptFileSize = mXmppConnectionService.getResources().getInteger(R.integer.auto_accept_filesize);
|
final int autoAcceptFileSize = mXmppConnectionService.getResources().getInteger(R.integer.auto_accept_filesize);
|
||||||
this.originalFileSize = FileBackend.getFileSize(mXmppConnectionService,uri);
|
this.originalFileSize = FileBackend.getFileSize(mXmppConnectionService,uri);
|
||||||
this.isVideoMessage = (mimeType != null && mimeType.startsWith("video/")) && originalFileSize > autoAcceptFileSize;
|
this.isVideoMessage = (mimeType != null && mimeType.startsWith("video/")) && originalFileSize > autoAcceptFileSize && !"uncompressed".equals(getVideoCompression());
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isVideoMessage() {
|
boolean isVideoMessage() {
|
||||||
|
@ -108,9 +108,14 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
|
if (e.getCause() instanceof Error) {
|
||||||
|
mXmppConnectionService.stopForcingForegroundNotification();
|
||||||
|
processAsFile();
|
||||||
|
} else {
|
||||||
Log.d(Config.LOGTAG, "ignoring execution exception. Should get handled by onTranscodeFiled() instead", e);
|
Log.d(Config.LOGTAG, "ignoring execution exception. Should get handled by onTranscodeFiled() instead", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTranscodeProgress(double progress) {
|
public void onTranscodeProgress(double progress) {
|
||||||
|
|
|
@ -116,10 +116,12 @@
|
||||||
<string-array name="video_compression_values">
|
<string-array name="video_compression_values">
|
||||||
<item>360</item>
|
<item>360</item>
|
||||||
<item>720</item>
|
<item>720</item>
|
||||||
|
<item>uncompressed</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="video_compression_entries">
|
<string-array name="video_compression_entries">
|
||||||
<item>@string/video_360p</item>
|
<item>@string/video_360p</item>
|
||||||
<item>@string/video_720p</item>
|
<item>@string/video_720p</item>
|
||||||
|
<item>@string/video_original</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -805,4 +805,5 @@
|
||||||
<string name="no_market_app_installed">No market app installed.</string>
|
<string name="no_market_app_installed">No market app installed.</string>
|
||||||
<string name="group_chat_will_make_your_jabber_id_public">This group chat will make your Jabber ID public</string>
|
<string name="group_chat_will_make_your_jabber_id_public">This group chat will make your Jabber ID public</string>
|
||||||
<string name="ebook">e-book</string>
|
<string name="ebook">e-book</string>
|
||||||
|
<string name="video_original">Original (uncompressed)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue