如何在聊天应用程序中发送媒体内容? [英] How to send media content in chat application?

查看:82
本文介绍了如何在聊天应用程序中发送媒体内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个使用ejabberd作为XMPP服务器和Smack 4.1 API的Android聊天应用程序。

I am designing a Android chat application using ejabberd as XMPP server and Smack 4.1 API.

我的要求是在聊天窗口中发送嵌入式图像,地图和视频。我意识到,通过XMPP Server(ejabberd)发送媒体内容在性能方面不是一个好主意。

我需要专家建议如何我要继续在聊天窗口中发送嵌入式媒体内容吗?

I need experts suggestions on how should i proceed with sending inline media content in chat window?

请先谢谢。

推荐答案

创建将使用multipart服务上载媒体数据(http后调用)的api。在服务的响应上获取url(获取http服务)并以xmpp消息的形式发送该url。

Create api that will upload the media data (http post call) using multipart service. on the responce of the service get the url (get http service) and send the url as xmpp message.

<message
    from='user1@hostName'
    id='richard2-4.1.247'
    to='user2@hostName'>
  <body>Sent a Image</body>
  <url>media url</url>
  <thumb> Base 64 </thumb>
</message>

当user2收到消息时,您可以致电服务部门以获取媒体数据

when user2 receive the message you can call service to get the media data

如果您遇到任何问题,请告诉我:cvofjaspreet@gmail.com

Let me know if you face any issue : cvofjaspreet@gmail.com

这篇关于如何在聊天应用程序中发送媒体内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆