# Receiving steam but not rendered, when using public ip as announcedIp

**URL:** <https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187>\
**Category:** Deployment & Scalability\
**Created:** [August 9, 2024, 3:30pm UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187 "2024-08-09T15:30:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepansh-maurya](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/deepansh-maurya/32/2667_2.png) [@deepansh-maurya](https://mediasoup.discourse.group/u/deepansh-maurya)\
**Post date:** [August 9, 2024, 3:30pm UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/1 "2024-08-09T15:30:47Z")

</div>

in this scenario where when i am using the announcedIp as 127.0.0.1 in this case everything is fine.

But when i am using my public ip as announced ip here the stream is not rendering. i am receiving the track from the server but when i am assigning the track to the video.srcobject then the video just buffers continously.

 ![image](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/2X/6/672c153a499385428fc5ee458a7e600b5cc80a8e.png)

---

<div class="post-metadata">

**Author:** ![hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hassan](https://mediasoup.discourse.group/u/hassan)\
**Post date:** [August 9, 2024, 3:57pm UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/2 "2024-08-09T15:57:38Z")

</div>

hi bro  
for this black screen that make in some cause  
ref…autoplay = true;  
ref.muted = true;  
ref.play();

i use this after addTrack and solved my problem.

---

<div class="post-metadata">

**Author:** ![deepansh-maurya](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/deepansh-maurya/32/2667_2.png) [@deepansh-maurya](https://mediasoup.discourse.group/u/deepansh-maurya)\
**Post date:** [August 9, 2024, 4:26pm UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/3 "2024-08-09T16:26:55Z")

</div>

no bro nothing happened  
how is this solution is aligned with my problem,  
my problem is related to the announced ip

---

<div class="post-metadata">

**Author:** ![hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hassan](https://mediasoup.discourse.group/u/hassan)\
**Post date:** [August 9, 2024, 5:08pm UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/4 "2024-08-09T17:08:23Z")

</div>

I used public host ip and work correctly  
I think 127.0.0.1 for ipv6 . I’m not sure.

if u use find dynamicaly use os like this

this is my mediasoup.config.ts

```auto
import * as mediasoup from 'mediasoup';

import os from 'os';
import * as dotenv from 'dotenv';

dotenv.config();

const { MEDIASOUP_LISTEN_IP,
    MEDIASOUP_ANNOUNCED_IP,
    MEDIASOUP_MIN_PORT,
    MEDIASOUP_MAX_PORT, } = process.env;

interface MediasoupConfig {
    numWorkers: number;
    workerSettings: {
        dtlsCertificateFile?: string;
        dtlsPrivateKeyFile?: string;
        logLevel: mediasoup.types.WorkerLogLevel;
        logTags: mediasoup.types.WorkerLogTag[];
    };
    routerOptions: mediasoup.types.RouterOptions;
    webRtcServerOptions: mediasoup.types.WebRtcServerOptions;
    webRtcTransportOptions: mediasoup.types.WebRtcTransportOptions;
    plainTransportOptions: mediasoup.types.PlainTransportOptions;
}

const address: mediasoup.types.TransportListenInfo[] = [];

(async () => {
    const myinterfaces = os.networkInterfaces();

    for (let interfacei in myinterfaces) {
        for (let interfeceinfo of myinterfaces[interfacei]) {
            if (!interfeceinfo.internal) {
                if (interfeceinfo.family === "IPv4") {
                    address.push({
                        protocol: "udp",
                        ip: "0.0.0.0",
                        announcedAddress: interfeceinfo.address,
                        // port: 4000,
                    })
                    address.push({
                        protocol: "tcp",
                        ip: "0.0.0.0",
                        announcedAddress: interfeceinfo.address,
                        // port: 4000,
                    })

                }
                // else if (interfeceinfo.family === "IPv6") {
                // address.push({
                // protocol: "udp",
                // ip: interfeceinfo.address,
                // announcedAddress: "142.132.152.236"
                // })
                // }
            }
            console.log("alllllll inteface addresss");

            console.log(interfeceinfo);
        }
    }

})()
console.log("addredss");
console.log(address);

const mediasoupConfiges: MediasoupConfig = {
    // Number of mediasoup workers to launch on CPU exist.
    numWorkers: Object.keys(os.cpus()).length,
    // mediasoup WorkerSettings.
    // See https://mediasoup.org/documentation/v3/mediasoup/api/#WorkerSettings
    workerSettings: {
        logLevel: "debug",
        logTags: ['info', 'ice', 'dtls', 'rtp', 'srtp', 'rtcp', 'rtx', 'bwe', 'score', 'simulcast', 'svc', 'sctp'],
        dtlsCertificateFile: "",
        dtlsPrivateKeyFile: "",
    },
    // mediasoup Router options.
    // See https://mediasoup.org/documentation/v3/mediasoup/api/#RouterOptions
    routerOptions: {
        mediaCodecs: [
            { kind: 'audio', mimeType: 'audio/opus', clockRate: 48000, channels: 2 },
            { kind: 'video', mimeType: 'video/VP8', clockRate: 90000, parameters: { 'x-google-start-bitrate': 1000 } },
            { kind: 'video', mimeType: 'video/VP9', clockRate: 90000, parameters: { 'profile-id': 2, 'x-google-start-bitrate': 1000 } },
            { kind: 'video', mimeType: 'video/h264', clockRate: 90000, parameters: { 'packetization-mode': 1, 'profile-level-id': '4d0032', 'level-asymmetry-allowed': 1, 'x-google-start-bitrate': 1000 } },
            { kind: 'video', mimeType: 'video/h264', clockRate: 90000, parameters: { 'packetization-mode': 1, 'profile-level-id': '42e01f', 'level-asymmetry-allowed': 1, 'x-google-start-bitrate': 1000 } }
        ]
    },

    webRtcServerOptions: {
        listenInfos: [...address,
        ],
    },
    // mediasoup WebRtcTransport options for WebRTC endpoints (mediasoup-client,
    // libmediasoupclient).
    // See https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions
    webRtcTransportOptions: {
        // listenInfos is not needed since webRtcServer is used.
        // However passing MEDIASOUP_USE_WEBRTC_SERVER=false will change it.
        listenInfos: [
            {
                protocol: 'udp',
                ip: MEDIASOUP_LISTEN_IP || '0.0.0.0',
                announcedAddress: MEDIASOUP_ANNOUNCED_IP,
                portRange: {
                    min: Number(MEDIASOUP_MIN_PORT) || 40000,
                    max: Number(MEDIASOUP_MAX_PORT) || 49999
                }
            },
            {
                protocol: 'tcp',
                ip: MEDIASOUP_LISTEN_IP || '0.0.0.0',
                announcedAddress: MEDIASOUP_ANNOUNCED_IP,
                portRange: {
                    min: Number(MEDIASOUP_MIN_PORT) || 40000,
                    max: Number(MEDIASOUP_MAX_PORT) || 49999
                }
            }
        ],
        initialAvailableOutgoingBitrate: 1000000,
        maxSctpMessageSize: 262144,
        enableUdp: true,
        // enableTcp: true,
        preferUdp: true,

    },

    plainTransportOptions: {
        listenInfo: {
            protocol: 'udp',
            ip: MEDIASOUP_LISTEN_IP || '0.0.0.0',
            announcedAddress: MEDIASOUP_ANNOUNCED_IP,
            portRange: {
                min: Number(MEDIASOUP_MIN_PORT) || 40000,
                max: Number(MEDIASOUP_MAX_PORT) || 49999
            }
        },
        maxSctpMessageSize: 262144
    }
}

```

---

<div class="post-metadata">

**Author:** ![deepansh-maurya](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/deepansh-maurya/32/2667_2.png) [@deepansh-maurya](https://mediasoup.discourse.group/u/deepansh-maurya)\
**Post date:** [August 9, 2024, 6:30pm UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/5 "2024-08-09T18:30:10Z")

</div>

Bro can we do 1 to 1 talk on my problem

It’s really frustrating for me now

---

<div class="post-metadata">

**Author:** ![hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hassan](https://mediasoup.discourse.group/u/hassan)\
**Post date:** [August 9, 2024, 7:28pm UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/6 "2024-08-09T19:28:32Z")

</div>

I’m not pro in mediasoup but if you new in mediasoup I suggest read document with some example in github

I read document this section again .

> **[mediasoup :: API](https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions)**
>
> Cutting Edge WebRTC Video Conferencing

use announcedAddress

but if reminded this error , may signaling doesn’t complete

do you use chrome://webrtc-internals ?

if signaling complete and data flow in chrome://webrtc-internals . it is sure error on client side but I think error is on signaling.

---

<div class="post-metadata">

**Author:** ![deepansh-maurya](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/deepansh-maurya/32/2667_2.png) [@deepansh-maurya](https://mediasoup.discourse.group/u/deepansh-maurya)\
**Post date:** [August 10, 2024, 3:10am UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/9 "2024-08-10T03:10:20Z")

</div>

and bro can share your repo

---

<div class="post-metadata">

**Author:** ![hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hassan](https://mediasoup.discourse.group/u/hassan)\
**Post date:** [August 10, 2024, 6:23am UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/10 "2024-08-10T06:23:51Z")

</div>

hi. this is big.  
let me send some section in this post to create small example.

---

<div class="post-metadata">

**Author:** ![deepansh-maurya](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/deepansh-maurya/32/2667_2.png) [@deepansh-maurya](https://mediasoup.discourse.group/u/deepansh-maurya)\
**Post date:** [August 10, 2024, 8:36am UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/11 "2024-08-10T08:36:47Z")

</div>

bro, You can simply share link of your repo

---

<div class="post-metadata">

**Author:** ![deepansh-maurya](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/deepansh-maurya/32/2667_2.png) [@deepansh-maurya](https://mediasoup.discourse.group/u/deepansh-maurya)\
**Post date:** [August 11, 2024, 4:46am UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/12 "2024-08-11T04:46:39Z")

</div>

Bro please send kardo

---

<div class="post-metadata">

**Author:** ![hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hassan](https://mediasoup.discourse.group/u/hassan)\
**Post date:** [August 11, 2024, 6:13am UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/13 "2024-08-11T06:13:01Z")

</div>

bro this is private repo 😅  
let me create simple repo

---

<div class="post-metadata">

**Author:** ![deepansh-maurya](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/deepansh-maurya/32/2667_2.png) [@deepansh-maurya](https://mediasoup.discourse.group/u/deepansh-maurya)\
**Post date:** [August 12, 2024, 3:33am UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/14 "2024-08-12T03:33:30Z")

</div>

Bhai send kar de link

---

<div class="post-metadata">

**Author:** ![hassan](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hassan](https://mediasoup.discourse.group/u/hassan)\
**Post date:** [August 12, 2024, 11:35am UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/15 "2024-08-12T11:35:07Z")

</div>

hi.  
I created it. may has some bug but work. I will complete in future.

> **[GitHub - hassanrahimi/SimpleMediasoupExample: this is simpole mediasoup example](https://github.com/hassanrahimi/SimpleMediasoupExample)**
>
> this is simpole mediasoup example

---

<div class="post-metadata">

**Author:** ![deepansh-maurya](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/deepansh-maurya/32/2667_2.png) [@deepansh-maurya](https://mediasoup.discourse.group/u/deepansh-maurya)\
**Post date:** [August 14, 2024, 4:59am UTC](https://mediasoup.discourse.group/t/receiving-steam-but-not-rendered-when-using-public-ip-as-announcedip/6187/16 "2024-08-14T04:59:43Z")

</div>

thanks bro
