canvas stream - fail event

seobi

New Member
Hello.
I'm testing the canvas stream with the latest version you provided. However, a failure event occurs on the second connection attempt.
As shown in the following log, it will run normally on the first attempt. However, it fails at the second attempt and cannot stream.
I would appreciate if you let me know what I am doing wrong.
Best regards.


[LOG]
// first - click start
============================================================================
flashphoner.js:35616 21:08:01 INFO webrtc - Initialized
flashphoner.js:35616 21:08:01 INFO websocket - Initialized
flashphoner.js:35616 21:08:01 INFO core - Initialized
FPStream.js:65 try connect (media server : wss://xxx.xxx.com:8443)
FPStream.js:136 #FP event status : CONNECTED
flashphoner.js:35616 21:08:01 INFO webrtc - {audio: false, video: false, customStream: MediaStream}
flashphoner.js:35616 21:08:01 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 0caf1690-1821-11ea-88ba-9b8261482fdb-LOCAL_CACHED_VIDEO
flashphoner.js:35682 Searching for codec H264
flashphoner.js:35686 H264 detected
flashphoner.js:35682 Searching for codec G722
flashphoner.js:35682 Searching for codec ALAW
flashphoner.js:35682 Searching for codec ULAW
FPStream.js:151 #FP event status : PUBLISHING
============================================================================

// first - click stop
============================================================================
FPStream.js:121 try stop stream
FPStream.js:159 #FP event status : UNPUBLISHED
FPStream.js:126 try disconnect (media server)
FPStream.js:144 #FP event status : DISCONNECTED
============================================================================


#second - click start
============================================================================
FPStream.js:65 try connect (media server : wss://xxx.xxx.com:8443)
FPStream.js:136 #FP event status : CONNECTED
flashphoner.js:35616 21:08:07 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 0caec870-1821-11ea-88ba-9b8261482fdb-LOCAL_CACHED_VIDEO
flashphoner.js:35616 21:08:07 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 0caec870-1821-11ea-88ba-9b8261482fdb-LOCAL_CACHED_VIDEO
flashphoner.js:35616 21:08:07 INFO webrtc - {audio: false, video: false, customStream: MediaStream}
flashphoner.js:35616 21:08:07 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 0caec870-1821-11ea-88ba-9b8261482fdb-LOCAL_CACHED_VIDEO
flashphoner.js:35616 21:08:07 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 100f5891-1821-11ea-88ba-9b8261482fdb-LOCAL_CACHED_VIDEO
flashphoner.js:35616 21:08:07 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 100f5891-1821-11ea-88ba-9b8261482fdb-LOCAL_CACHED_VIDEO
flashphoner.js:35682 Searching for codec H264
6flashphoner.js:35686 H264 detected
flashphoner.js:35682 Searching for codec G722
flashphoner.js:35682 Searching for codec ALAW
flashphoner.js:35682 Searching for codec ULAW
flashphoner.js:35682 Searching for codec H264
flashphoner.js:35682 Searching for codec G722
flashphoner.js:35682 Searching for codec ALAW
flashphoner.js:35682 Searching for codec ULAW
FPStream.js:110 #FP event status : STREAM_STATUS.FAILED
FPStream.js:159 #FP event status : UNPUBLISHED
FPStream.js:126 try disconnect (media server)
flashphoner.js:35616 21:08:07 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 101042f0-1821-11ea-88ba-9b8261482fdb-REMOTE_CACHED_VIDEO
FPStream.js:110 #FP event status : STREAM_STATUS.FAILED
FPStream.js:159 #FP event status : UNPUBLISHED
FPStream.js:126 try disconnect (media server)
FPStream.js:144 #FP event status : DISCONNECTED
 
Last edited:

Max

Administrator
Staff member
We raised ticket WCS-2402. Will will let you know once we have any news.
 

Max

Administrator
Staff member
Good day.
Unfortunately, we cannot reproduce the issue you describe, so please clarify the following:
1) Your test environment: OS, browser
2) WCS version, WebSDK version (probably the latest with Canvas Streaming example fix)
3) Does the issue occurs using Canvas Streaming example without any changes? If not, please provide us a minumally customized code example to reproduce the issue to support@flashphoner.com, we will check
 

Max

Administrator
Staff member
Good day.
Thank you, we received code example from you. We will check.
 

Max

Administrator
Staff member
Good day.
We've checked your code and found the reason for this issue. There ia the following code in FPStream.js:
Code:
sunny.startCanvasStream = async function(stream) {
    FPStream.initialize();
    FPStream.connect(sunny.MEDIASERVER);

    document.addEventListener('onMediaServerConnected', async function (e) {
        var constraints = { audio: false, video: false }
        FPStream.startStreaming(sunny.STREAMKEY, constraints, stream);
    });

    document.addEventListener('onMediaServerDisconnected', function (e) {
    });
}
We added listener removing:
Code:
unny.startCanvasStream = async function(stream) {
    FPStream.initialize();
    FPStream.connect(sunny.MEDIASERVER);


    var onMediaServerConnectedListener = async function (e) {
        var constraints = { audio: false, video: false }
        FPStream.startStreaming(sunny.STREAMKEY, constraints, stream);
    };

    document.addEventListener('onMediaServerConnected', onMediaServerConnectedListener);

    document.addEventListener('onMediaServerDisconnected', function (e) {
        document.removeEventListener('onMediaServerConnected', onMediaServerConnectedListener);
    });
}
Then, second canvas stream publishing works after previous unpublishing. Please, apply the changes described above and check.
 

seobi

New Member
I realized it was my stupid mistake.
Thank you for the reply.

I've also asked you a question about e-mail, but I'll ask you a question separately because it's different from this issue.
Thank you very much.
 
Top