Will the requested video stream be automatically disconnect when my web page navigated away from my video page.

Dear All,

Currently, I have a video page that will stream 18 video feeds after I requested the video via XPMobileSDK to mobile Server.

I am concerned that the videos are still streaming and used up the resources.

Best Regards

Eric Tan

Hello Eric,

the default behavior of the Mobile Server is to close the video connections 30 seconds after it detects that the client does not consume video.

If you are experience other behavior please let us know what is the scenario, so that we can investigate.

Best regards

Teodor

Hi Teodor,

Thanks for the info.

Indeed I realized that every tab is a new session that result a new connection. Even when I navigate out of the tab, the connection still remains until 30 sec later. This maybe bad when there is a spike of resources usage within the 30 sec. (Because our client and VMS is running in the same host due to Hardware constraint)

Hence, I will do a XPMobileSDK.disconnect() whenever I left the page without using the closeStream(videoId).

Is it okay for me to do a disconnect() only since I read the reference library and it stated the following:

Disconnect(params, successCallback, failCallback)

Sends a Disconnect connection command and logs out the current user. (Stops all the open video communication channels, removes ConnectionId from the internal resolving mechanism)

disconnect()

Sends a Disconnect connection command and logs out the current user.

Best Regards

Eric Tan

Yes Eric, that is enough to send just disconnect command. In the Web Client where we are also using the XPMobile SDK we also listen for the beforeunload (https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) and send disconnect command to the server.

Hope that helps

Teodor

Noted with Thanks