How to send media content in chat application?

醉酒当歌 提交于 2019-12-08 12:37:33

问题


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

My requirement is to send inline images, maps and videos in chat windows. I realized that, sending media content through XMPP Server(ejabberd) is not a good idea when it comes to performance.

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

Thanks in advance.


回答1:


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>

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

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



来源:https://stackoverflow.com/questions/30371701/how-to-send-media-content-in-chat-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!