mirror of
https://github.com/accelforce/Yuito
synced 2025-01-15 17:07:33 +01:00
Add support for sharing audio attachments (#1629)
This commit is contained in:
parent
9dccd06a06
commit
f903cc50e1
@ -254,8 +254,9 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener
|
|||||||
val attachment = attachments!![viewPager.currentItem].attachment
|
val attachment = attachments!![viewPager.currentItem].attachment
|
||||||
when (attachment.type) {
|
when (attachment.type) {
|
||||||
Attachment.Type.IMAGE -> shareImage(directory, attachment.url)
|
Attachment.Type.IMAGE -> shareImage(directory, attachment.url)
|
||||||
|
Attachment.Type.AUDIO,
|
||||||
Attachment.Type.VIDEO,
|
Attachment.Type.VIDEO,
|
||||||
Attachment.Type.GIFV -> shareVideo(directory, attachment.url)
|
Attachment.Type.GIFV -> shareMediaFile(directory, attachment.url)
|
||||||
else -> Log.e(TAG, "Unknown media format for sharing.")
|
else -> Log.e(TAG, "Unknown media format for sharing.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,7 +320,7 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun shareVideo(directory: File, url: String) {
|
private fun shareMediaFile(directory: File, url: String) {
|
||||||
val uri = Uri.parse(url)
|
val uri = Uri.parse(url)
|
||||||
val mimeTypeMap = MimeTypeMap.getSingleton()
|
val mimeTypeMap = MimeTypeMap.getSingleton()
|
||||||
val extension = MimeTypeMap.getFileExtensionFromUrl(url)
|
val extension = MimeTypeMap.getFileExtensionFromUrl(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user