seobi
New Member
Hello.
I'm testing a Canvas Stream with a tip you gave me. Another error occurred during the test. I report it.
In my sample, an error occurs intermittently when disconnecting:
Assigning 'display' to the createStream method as a static 'div' element (localVideo) should not cause any problems. However, assigning a dynamically created 'div' causes problems. I delete the dynamically created div on Flashphoner's Disconnect event. Should I keep it without deleting it?
Note, I was loading and publishing a Full HD video file on Canvas.
Best Regard.
[Sample Code]
[LOG]
==================================================================================
flashphoner.js:35616 09:54:55 INFO webrtc - Initialized
flashphoner.js:35616 09:54:55 INFO websocket - Initialized
flashphoner.js:35616 09:54:55 INFO core - Initialized
FPStream.js:77 connect to flashphoner media server : wss://marioms.rsupport.com:8443
FPStream.js:152 #FP Status : CONNECTED
flashphoner.js:35616 09:54:55 INFO webrtc - {audio: false, video: false, customStream: MediaStream}
flashphoner.js:35616 09:54:55 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 0387ca00-1c7a-11ea-9d45-3323c4f2244b-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
FPStream.js:174 #FP Status : PUBLISHING
flashphoner.js:36217 Uncaught (in promise) TypeError: Cannot read property 'srcObject' of null
at flashphoner.js:36217
at flashphoner.js:36211
(anonymous) @ flashphoner.js:36217
(anonymous) @ flashphoner.js:36211
Promise.then (async)
getStat @ flashphoner.js:36209
detectConnectionQuality @ flashphoner.js:11955
streamRefreshHandlers.<computed> @ flashphoner.js:11914
wsConnection.onmessage @ flashphoner.js:10893
FPStream.js:182 #FP Status : UNPUBLISHED
FPStream.js:160 #FP Status : DISCONNECTED
I'm testing a Canvas Stream with a tip you gave me. Another error occurred during the test. I report it.
In my sample, an error occurs intermittently when disconnecting:
Assigning 'display' to the createStream method as a static 'div' element (localVideo) should not cause any problems. However, assigning a dynamically created 'div' causes problems. I delete the dynamically created div on Flashphoner's Disconnect event. Should I keep it without deleting it?
Note, I was loading and publishing a Full HD video file on Canvas.
Best Regard.
[Sample Code]
if (localvideo == null) {
publishStream = session.createStream({
.....
}
Flashphoner.createSession({urlServer: url}).on(SESSION_STATUS.ESTABLISHED, function (session) {
onDisconnected() {
localvideo = document.createElement('div');
}publishStream = session.createStream({
name: streamKey,
display: localvideo,
}).on(STREAM_STATUS.PUBLISHING, function (stream) {display: localvideo,
.....
}
Flashphoner.createSession({urlServer: url}).on(SESSION_STATUS.ESTABLISHED, function (session) {
onConnected(session);
}).on(SESSION_STATUS.DISCONNECTED, function () {onDisconnected();
}).on(SESSION_STATUS.FAILED, function () {onDisconnected();
});onDisconnected() {
localvideo.remove();
localvideo = null;
}localvideo = null;
[LOG]
==================================================================================
flashphoner.js:35616 09:54:55 INFO webrtc - Initialized
flashphoner.js:35616 09:54:55 INFO websocket - Initialized
flashphoner.js:35616 09:54:55 INFO core - Initialized
FPStream.js:77 connect to flashphoner media server : wss://marioms.rsupport.com:8443
FPStream.js:152 #FP Status : CONNECTED
flashphoner.js:35616 09:54:55 INFO webrtc - {audio: false, video: false, customStream: MediaStream}
flashphoner.js:35616 09:54:55 INFO webrtc - FOUND WEBRTC CACHED INSTANCE, id 0387ca00-1c7a-11ea-9d45-3323c4f2244b-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
FPStream.js:174 #FP Status : PUBLISHING
flashphoner.js:36217 Uncaught (in promise) TypeError: Cannot read property 'srcObject' of null
at flashphoner.js:36217
at flashphoner.js:36211
(anonymous) @ flashphoner.js:36217
(anonymous) @ flashphoner.js:36211
Promise.then (async)
getStat @ flashphoner.js:36209
detectConnectionQuality @ flashphoner.js:11955
streamRefreshHandlers.<computed> @ flashphoner.js:11914
wsConnection.onmessage @ flashphoner.js:10893
FPStream.js:182 #FP Status : UNPUBLISHED
FPStream.js:160 #FP Status : DISCONNECTED