How to change default WSS adress in Webrtc as rtmp rebublishing

tyagi5011

New Member
I want to change the default wss address in webrtc as rtmp rebublishing because i installed the wcs on another server so i want that adress to be default

I checked this method but it is not working.

please help.


function init_page() {
$("#url").val("wss://wcs_address:8443");
loadPlayer();
...
}
 

Max

Administrator
Staff member
Good day.
We tested this as follows:
1. Modify the file /usr/local/FlashphonerWebCallServer/client2/examples/demo/streaming/webrtc-as-rtmp-republishing/webrtc-as-rtmp-republishing.js
1610332416908.png

2. Open WebRTC as RTMP example https://test1.flashphoner.com:8444/client2/examples/demo/streaming/webrtc-as-rtmp-republishing/webrtc-as-rtmp-republishing.html
1610332508273.png

As you can see, websocket URL is substituted correctly, the stream is publishing successfully
So please check if you're modifying the code and running the test on the same server. For example, if WebSDK and the example code is placed on a different web server, it should be modified there.
You can also set a fixed websocket URL directly in createSession call if you do not want client to change the URL
Code:
function start() {
    //check if we already have session
    if (Flashphoner.getSessions().length > 0) {
        startStreaming(Flashphoner.getSessions()[0]);
    } else {
        //create session
        var url = "wss://wcs_address:8443";//field('url');
        console.log("Create new session with url " + url);
        Flashphoner.createSession({urlServer: url}).on(SESSION_STATUS.ESTABLISHED, function(session){
            //session connected, start streaming
            startStreaming(session);
            ...
        });
    }
}
Plaese also check if websocket port 8443 is available on WCS server.
 
Top