Problem with Playing video or voice message in Android/IOS App

Description:

I have problem with Rocket.Chat app on phones. the voice and videos does not play in phones on both IOS and Android devices. on phones when i open the RocketChat in web browser it works but in app it does not work.

my rocketchat instance is running on Docker on port 3000 and outside of docker, i have installed nginx on my local server that proxy port 443 to 3000. this is my nginx config for my rocketchat. maybe there is something to add or modify to fix this?

server {

    server_name chat.domain.com;

    location / {
        proxy_pass http://rocketchat:3000;
    }
    # Proxy font requests from domain.com
    location /files/fonts/ {
        proxy_pass https://domain.com/files/fonts/;
        proxy_set_header Host domain.com;
        add_header Access-Control-Allow-Origin "*";
        add_header Access-Control-Allow-Methods "GET, OPTIONS";
        add_header Access-Control-Allow-Headers "Content-Type";
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/chat.domain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/chat.domain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Nginx-Proxy true;
    proxy_redirect off;
    proxy_connect_timeout 90;
    proxy_send_timeout 90;
    proxy_read_timeout 90;
    client_max_body_size 1024M;
    add_header Access-Control-Allow-Origin *;
}
server {
    if ($host = chat.domain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    server_name chat.domain.com;
    return 404; # managed by Certbot
}

Also, my files stored in S3 Storage ( not AWS, its local on another server ) and its not GridFS or ..

i seen multiple issues about this problem but there was no clear solution about it. any idea?

Expected behavior:

Fix loading and playing voice and videos in android/ios apps.

Server Setup Information:

  • Version of Rocket.Chat Server: 7.5.1 ( Latest )
  • License Type: Community
  • Number of Users: 482
  • Operating System: Ubuntu 22.04.5 LTS
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • NodeJS Version: V22.13.1
  • MongoDB Version: 6.0.13 / wiredTiger (oplog Enabled)

Client Setup Information

  • Desktop App or Browser Version: Android/IOS App
  • Operating System: Android / IOS

Likely websockets or certs.

Go back to a stock nginx as per the docs.

Check your certs. Make sure no one has logged in locally on http://server:3000 and modified the Site-URL

1 Like

i rolled back to original/default nginx config. nothing changed.
also all of my clients use the domain with out the port. including me. because i have this problem as well.

also, there is another thing. when i clear cache and data of app ( in android ) and open the chat for the first time, it will load. but then i switch between chats, the same voice that loaded earlier, does not load and shows 0 second time.

something switching multiple times between chats in app ( both IOS/ANDROID ) load the voice but most of the times, it does not.

Post it - no one can help without seeing it.

Is it the default setup in the docs?

FWIW I just tested on my test 7.5.1 CE setup - uses apache, not nginx - with file store and zero issues uploading and playing a mp4 file.

What do your logs tell you?? Set the m to debug and look at them and also web server logs.

Check your websockets and make sure you are using https.

this is my current nginx config.

server {
     listen 443 ssl;

     server_name chat.domain.com; #replace <ABC.DOMAIN.COM> with your domain name

     ssl_certificate /etc/letsencrypt/live/chat.domain.com/fullchain.pem; #replace <ABC.DOMAIN.COM> with your domain name
     ssl_certificate_key /etc/letsencrypt/live/chat.domain.com/privkey.pem; #replace <ABC.DOMAIN.COM> with your domain name
     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
     ssl_prefer_server_ciphers on;
     ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

     root /usr/share/nginx/html;
     index index.html index.htm;

     # Make site accessible from http://localhost/
     server_name chat.domain.com;

     location / {
         proxy_pass http://localhost:4000/;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_set_header Host $http_host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto http;
         proxy_set_header X-Nginx-Proxy true;
         proxy_redirect off;
     }
 }

 server {
     listen 80;

     server_name chat.domain.com); #replace <ABC.DOMAIN.COM> with your domain name

     return 301 https://$host$request_uri;
 }

yes i used default setup just like the docs.
the main problem is with the audios ( even those recorded with rocketchat app itself ). i attached some screenshot for better reference

as you can see, a voice below loaded and when in another attempts, it did not.
should i switch to apache? or any tweaking in nginx config can solve it?

You need to follow the docs exactly.

Really?

Does it say that in the example?

Copy the nginx config from here and JUST change the domain where it says so:

my brother. my actual domain is not chat.domain.com :sweat_smile: . i can’t share my actual URL of my organization for security purposes.

also, with port 3000 was the same. with EXACT config of nginx have the same prolem. right now, i am on default nginx config. only using my actual URL of instance and path of my ssl. anything else is default.

I know.

     # Make site accessible from http://localhost/
     server_name chat.domain.com;

But you don’t set it here.

Also, don’t use 4000. It should be 3000.

Read the docs properly.

Form the docs.

server {
     listen 443 ssl;

     server_name <ABC.DOMAIN.COM>; #replace <ABC.DOMAIN.COM> with your domain name

     ssl_certificate /etc/letsencrypt/live/<ABC.DOMAIN.COM>/fullchain.pem; #replace <ABC.DOMAIN.COM> with your domain name
     ssl_certificate_key /etc/letsencrypt/live/<ABC.DOMAIN.COM>/privkey.pem; #replace <ABC.DOMAIN.COM> with your domain name
     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
     ssl_prefer_server_ciphers on;
     ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

     root /usr/share/nginx/html;
     index index.html index.htm;

     # Make site accessible from http://localhost/
     server_name localhost;

     location / {
         proxy_pass http://localhost:3000/;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_set_header Host $http_host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto http;
         proxy_set_header X-Nginx-Proxy true;
         proxy_redirect off;
     }
 }

 server {
     listen 80;

     server_name <ABC.DOMAIN.COM>; #replace <ABC.DOMAIN.COM> with your domain name

     return 301 https://$host$request_uri;
 }

ONLY change the bits that say ABC.DOMAIN.COM

Nothing else.

If you are using docker it Rocket run on 3000 (because node does) so no idea what else you have going on but something you aren’t telling us.

idk why you thing there something that i don’t tell. i don’t play games.
my problem is obvious. and its not just me. there is +10 posts in github issues or other forums about this bug and there is NO SOLUTION about it.

my nginx config is EXACTLY THE SAME as the doc right now.

at this moment, i switched back to port 3000 and everything is on default setting.
all of the setting in rocketchat setting itself is default.
EVERY THING IS DEFAULT!

for testing ONLY, i activated a Pro Trial license from Cloud.Rocket.Chat to see its license problem. IT WAS NOT. problem is still there.

there is nothing else to share. its all.

[quote=“imanerfanian, post:10, topic:22043”]
idk why you thing there something that i don’t tell.[/quote]

Because I have been doing this a long time and have a good idea when something is not quite right. I haven’t accused you of playing games. I just know that often we do not get told the whole story.

You told me you had followed the docs and then posted something that was not in the docs.

:exploding_head:

You had used port 4000 - how/why did you do that and what difference do you think it would make?

See https://xyproblem.info/

Pretty well every issue I have seen with this is down to configuration. Just the way it is.

I have tested this on a couple of versions and on Rocket.Chat open server and they play without issue.

Have you tested with your mobiles on open.rocket.chat?

Use #general and try it.

i tried you suggestions. i am on default nginx config. i am on latest docker update. my mongo version is 6. at this moment i am on community license.

is there any logs for mobile apps? how can i debug this?
what else to check?

Yes I already told you:

the voice works on open rocketchat server. i tried it already.
i mean any other thing to check on my server side to MAYBE fix this?

You never mentioned this.

Did you try video as well?

Assuming you have then the issue is your setup somewhere.

Site URL set correctly to https://chat.yourdomain.com ?

Are you ONLY accessing it via the URL and not localhost ?

Have you checked your certs?

Have you checked your websockets?

What do your Rocket chat and Ngijnx logs say?

i checked the Open Rocketchat server again. the voice cannot play. i think its the app problem. i will attach the screenshots.
the first time that i open the group, voice did not open. second time it did and the last time, it did not. i think its the app or my network. i test it with my Sim cart network and wifi. i test it in my home network and company network. also employees across the country connect to rocketchat instance and still have this problem.

yes

yes

I use free lets enectyp cert. i renew them again this morning.

yes they are enable and working fine.

while i am working on mobile app, there is no log in both rocketchat docker instance & nginx logs

Just tested voice on open.rocket without any issues.

I can also hear your message you left on #support

sometimes i can hear it. when i switch between channels, sometime it play and sometimes it does not. i test it with android/ ios phone. still there.
any idea?

If it struggles with open.rocket then you have issues your end somewhere but hard to pinpoint,

I have asked someone form the team to have a look as I am going on vacation in the morning.

1 Like