screen sharing stream custom

Max

Administrator
Staff member
Good day.

To specify stream name - enter its custom name in the field, indicated on the picture (before stream is published). In the example, we specified name of the stream: "testStream":

screen-sharing.png
 

gurmeet

Member
1. too many files open error server hang and i have to restart the server how to solve this have a look on my properties files with attachments

2. how to configure two webcall server load balancer can u please describe properly to me so i can configure

3. can you please tell me to change demo user password
4. no port availabe error
 

Attachments

Last edited:

Max

Administrator
Staff member
Good day.
1. too many files open error server hang and i have to restart the server how to solve this have a look on my properties files with attachments
Please add output of lsof and netstat (file lsof.log and netstat.log) in attach:
Code:
lsof -P -c java >lsof.log
Code:
netstat -antpul >netstat.log
2. how to configure two webcall server load balancer can u please describe properly to me so i can configure
There currently we have no load balancing in WCS.
You can use several solutions:
1. Use HAProxy to balance incoming connections on WCS.
2. Based on the statistics, decide for which WCS server sends request.
Code:
https://<Your WCS domain or IP-address>:8444/?action=stat
3. can you please tell me to change demo user password
You can get access to core CLI via SSH
Code:
ssh -p 2001 admin@localhost
and change password to user demo
Code:
passwd demo
4. no port availabe error
How many simultaneous subscriptions on your servers?
Which version WCS are you using?
Code:
cat /usr/local/FlashphonerWebCallServer/conf/WCS.version
 

gurmeet

Member
https://t3n.crakex.in:8888/?action=stat
-----Connection Stats-----
connections=226
connections_rtmfp=0
connections_websocket=226
-----Port Stats-----
ports_media_free=3671
ports_media_busy=306
ports_media_quarantine=22
-----Stream Stats-----
streams_webrtc_in=7
streams_webrtc_out=51
streams_websocket_out=82
streams_rtmfp_in=0
streams_rtmfp_out=0
streams_rtmp_in=8
streams_rtmp_out=0
streams_viewers=pokert20/2,ch_99/0,rtmp://dreamexch9.co.in:1935/live/ch_99/1,lucky7ud/2,rtmp://dreamexch9.co.in:1935/live/ch_77/1,ch_66/0,ch_88/0,3pati1day/34,rtmp://dreamexch9.co.in:1935/live/ch_66/1,poker1day/1,rtmp://dreamexch9.co.in:1935/live/ch_88/1,3patit20/92,3patitest/1,ab20/1,ch_77/0
streams_rtsp_in=0
streams_rtsp_out=0
streams_rtmp_client_out=0
streams_play_rate=2
streams_stop_rate=0
-----Native Resources-----
native_resources=140099093908816,NENC:H264/FFMPEG,7919;140099338478432,FFDecoderNative:H264/FFMPEG,9966385;124421152,NENC:VP8/FFMPEG,71403;140100966534832,NENC:VP8/FFMPEG,1260451;42226704,FFDecoderNative:H264/FFMPEG,426024582;140100640130256,FFDecoderNative:H264/FFMPEG,3569631;140099295770672,NENC:H264/FFMPEG,4739;37745184,NENC:H264/FFMPEG,9806;140100643757584,FFDecoderNative:H264/FFMPEG,16650744;140099532435344,FFDecoderNative:H264/FFMPEG,4323868;138908704,NENC:H264/FFMPEG,7993;140099295773952,FFDecoderNative:H264/FFMPEG,19134561;140098911750656,NENC:MPV/FFMPEG,34222;
native_resources.audio_codecs=0
native_resources.audio_resamplers=0
native_resources.video_transcoders=0
native_resources.video_decoders=6
native_resources.video_encoders=7
native_resources.writers=0
-----Core Stats-----
core_java_threads=651
core_java_committedMemory=30053560320
core_java_freePhysicalMemorySize=15306993664
core_java_arch=amd64
core_java_availableProcessors=16
core_java_freeSwapSpaceSize=536866816
core_java_maxFileDescriptorCount=20000
core_java_open_file_descriptors=16551
core_java_cpu_usage=15.05
core_java_totalPhysicalMemorySize=67559202816
core_java_totalSwapSpaceSize=536866816
core_java_uptime=7598062
-----Call Stats-----
sip_processed_calls=0
sip_calls_state=established/0,trying/0,ringing/0,ring/0,ring_media/0,hold/0,busy/0,finish/0,session_progress/0,pending/0,failed/0
sip_calls=0
sip_calls_established=0
sip_calls_in=0
sip_calls_out=0
sip_calls_per_second=0.00
-----Sip Stats-----
sip_registered=0
-----Recording Stats-----
recording_sessions=0
-----System Stats-----
system_java_cpu_usage=8.51
system_java_load_average=1.96
-----Network Stats (Mbit/s)-----
global_bandwidth_in=0.000
global_bandwidth_out=0.000
-----Version info-----
wcs_version=5.2.310-8357606cfd5be138a9fa321794f01d8ca70db843
wcs_client_version=0.5.28.2753-49b4a7e959975d05d33a3e1c7e7af6d2b7aa9cb6
-----Errors info-----
java.lang.IndexOutOfBoundsException=1
javax.net.ssl.SSLException=4
java.nio.channels.ClosedChannelException=9
java.net.SocketTimeoutException=9
java.io.IOException=8288
java.lang.ArrayIndexOutOfBoundsException=33
java.lang.IllegalArgumentException=1
com.flashphoner.server.commons.rmi.operations.exception.AgentNotFoundException=4
java.lang.NullPointerException=3
java.lang.Exception=1
-----Degraded streams-----
degraded_streams=
degraded_streams_percent=0

---------------------------
https://t3n.crakex.in:8444/?action=stat
-----Connection Stats-----
connections=232
connections_rtmfp=0
connections_websocket=232
-----Port Stats-----
ports_media_free=3655
ports_media_busy=316
ports_media_quarantine=28
-----Stream Stats-----
streams_webrtc_in=7
streams_webrtc_out=57
streams_websocket_out=82
streams_rtmfp_in=0
streams_rtmfp_out=0
streams_rtmp_in=8
streams_rtmp_out=0
streams_viewers=pokert20/2,ch_99/0,rtmp://dreamexch9.co.in:1935/live/ch_99/1,lucky7ud/2,rtmp://dreamexch9.co.in:1935/live/ch_77/1,ch_66/1,ch_88/0,3pati1day/35,rtmp://dreamexch9.co.in:1935/live/ch_66/1,poker1day/1,rtmp://dreamexch9.co.in:1935/live/ch_88/1,3patit20/95,3patitest/1,ab20/2,ch_77/0
streams_rtsp_in=0
streams_rtsp_out=0
streams_rtmp_client_out=0
streams_play_rate=1
streams_stop_rate=0
-----Native Resources-----
native_resources=140099093908816,NENC:H264/FFMPEG,10588;140099338478432,FFDecoderNative:H264/FFMPEG,13254099;140099295464080,mpeg4-generic,0;124421152,NENC:VP8/FFMPEG,80209;140100966534832,NENC:VP8/FFMPEG,1277292;140099530228800,FFDecoderNative:H264/FFMPEG,13577608;42226704,FFDecoderNative:H264/FFMPEG,432729345;140100640130256,FFDecoderNative:H264/FFMPEG,4767291;140099295770672,NENC:H264/FFMPEG,6313;140100628854784,NENC:VP8/FFMPEG,3787;37745184,NENC:H264/FFMPEG,13007;140100643757584,FFDecoderNative:H264/FFMPEG,18798249;194281648,mpeg4-generic,0;140099532435344,FFDecoderNative:H264/FFMPEG,5772721;138908704,NENC:H264/FFMPEG,10661;140099295773952,FFDecoderNative:H264/FFMPEG,25382481;140098911750656,NENC:MPV/FFMPEG,44032;
native_resources.audio_codecs=2
native_resources.audio_resamplers=0
native_resources.video_transcoders=0
native_resources.video_decoders=7
native_resources.video_encoders=8
native_resources.writers=0
-----Core Stats-----
core_java_threads=685
core_java_committedMemory=30094557184
core_java_freePhysicalMemorySize=15228837888
core_java_arch=amd64
core_java_availableProcessors=16
core_java_freeSwapSpaceSize=536866816
core_java_maxFileDescriptorCount=20000
core_java_open_file_descriptors=16664
core_java_cpu_usage=16.30
core_java_totalPhysicalMemorySize=67559202816
core_java_totalSwapSpaceSize=536866816
core_java_uptime=7698093
-----Call Stats-----
sip_processed_calls=0
sip_calls_state=established/0,trying/0,ringing/0,ring/0,ring_media/0,hold/0,busy/0,finish/0,session_progress/0,pending/0,failed/0
sip_calls=0
sip_calls_established=0
sip_calls_in=0
sip_calls_out=0
sip_calls_per_second=0.00
-----Sip Stats-----
sip_registered=0
-----Recording Stats-----
recording_sessions=0
-----System Stats-----
system_java_cpu_usage=7.14
system_java_load_average=2.20
-----Network Stats (Mbit/s)-----
global_bandwidth_in=0.000
global_bandwidth_out=0.000
-----Version info-----
wcs_version=5.2.310-8357606cfd5be138a9fa321794f01d8ca70db843
wcs_client_version=0.5.28.2753-49b4a7e959975d05d33a3e1c7e7af6d2b7aa9cb6
-----Errors info-----
java.lang.IndexOutOfBoundsException=1
javax.net.ssl.SSLException=4
java.nio.channels.ClosedChannelException=9
java.net.SocketTimeoutException=9
java.io.IOException=8375
java.lang.ArrayIndexOutOfBoundsException=33
java.lang.IllegalArgumentException=1
com.flashphoner.server.commons.rmi.operations.exception.AgentNotFoundException=4
java.lang.NullPointerException=3
java.lang.Exception=1
-----Degraded streams-----
degraded_streams=
degraded_streams_percent=0
-----------------------------
wcs version
5.2.310-8357606cfd5be138a9fa321794f01d8ca70db843
 

Attachments

Max

Administrator
Staff member
Good day.
We see on the statistics page https://t3n.crakex.in:8444/?action=stat:
Code:
-----Core Stats-----
...
core_java_maxFileDescriptorCount=20000
core_java_open_file_descriptors=18190
...
The number of file descriptors (18190) for the webcallserver process is almost the maximum allowed (20,000).
There are a few ways to work fix this:
1. In the file /usr/local/FlashphonerWebCallServer/bin/webcallserver change the value ulimit to the one you need. Default value:
Code:
ulimit -n 20000
and restart WCS.
2. We recommend in production use:
- WCS server
- Your web server, like apache or nginx, to requests from clients and for Play/Publish application (e.g. screen-sharing.js + screen-sharing.html). That is, you install nginx or apache, copi and customize necessary files. For example:
Code:
/usr/local/FlashphonerWebCallServer/client2/examples/demo/streaming/screen-sharing.js
/usr/local/FlashphonerWebCallServer/client2/examples/demo/streaming/screen-sharing.html
From this pages you can set wss://<Your WCS server>:8443 to connect to your WCS server.
 

gurmeet

Member
for rest authentication
i first add
update app -l http://139.162.213.9/defaultApp
then my server (webcall) stop working
then i want to go default setting for that i ran
remove app defaultApp
after restart my server i got bellow error how can i solve this
error
RestClient - API-ASYNC-pool-12-thread-2 Method StreamStatusEvent not available for app defaultApp
 

gurmeet

Member
please describe me to how can i restrict user to play a video
means client side video play restriction implement
i want to restrict user by their password and create a new token every time login and that token is sent via wcs server to authecation server. and depending to this tocken authentication server send status code 200 for ok or denied by 403 status
 

Max

Administrator
Staff member
Good day.
after restart my server i got bellow error how can i solve this error
RestClient - API-ASYNC-pool-12-thread-2 Method StreamStatusEvent not available for app defaultApp
Please see current status defaultApp in WCS CLI, you may not have returned the default settings for defaultApp:
Code:
ssh -p 2001 admin@localhost
% show apps
name              appKey            URL
------------------------------------------------------------------------------
chatRoomApp       chatRoomApp       http://localhost:8081/apps/ChatRoomApp
callApp           callApp           http://localhost:8081/apps/CallApp
chatRoomApp       flashRoomApp      http://localhost:8081/apps/RoomApp
clickToCallApp    clickToCallApp    http://localhost:8081/apps/ClickToCallApp
qaApp             qaApp             http://localhost:8081/apps/QAApp
defaultApp        defaultApp        http://localhost:8081/apps/EchoApp
wcs3App           wcs3App           http://localhost:8081/apps/EchoApp
websocketChatApp  websocketChatApp  http://localhost:8081/apps/ChatApp
flashStreamingApp flashStreamingApp http://localhost:8081/apps/EchoApp
chatRoomApp       roomApp           http://localhost:8081/apps/RoomApp
conferenceApp     conferenceApp     http://localhost:8081/apps/ConferenceApp
flashChatApp      flashChatApp      http://localhost:8081/apps/ChatApp
Please use for origin value defaultApp:
Code:
update app -l "http://localhost:8081/apps/EchoApp" defaultApp
When stream is PENDING, PLAYING, STOPPED or FAILED, WCS sends /StreamStatusEvent to the back-end. If you use custom defaultApp, then you will have to process the REST method is an event StreamStatusEvent on the back-end server.

please describe me to how can i restrict user to play a video
means client side video play restriction implement
We can offer this authorization method to restrict access the WCS:
1. Customize your REST hook on the back-end server:
Code:
https://<your back-end server>/hook/connect
2. With POST request, the REST hook of your back-end should return 403 Forbidden if the client is not authorized to access WSS, if access is allowed 200 OK. For example, create php file that implements this logic:
PHP:
<?php
   header('HTTP/1.1 403 Forbidden',true,403);
?>
3. Check the changes:
Code:
[root@p16 /]# curl -k -I https://<your back-end server>/hook/connect
HTTP/1.1 403 Forbidden
Date: Thu, 31 Oct 2019 16:48:39 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
X-Powered-By: PHP/5.4.16
Content-Type: text/html; charset=UTF-8
4. Your WCS server must be configured to work with REST hook. Connect to the WCS CLI (default password is admin):
Code:
ssh -p 2001 admin@localhost
and update the defaultApp application:
Code:
update app -l https://<your back-end server>/hook defaultApp
5. Open this page in browser:
Code:
https://<your WCS IP-address or domain name>:8444/client2/examples/demo/streaming/screen-sharing/screen-sharing.html
Connection to wss://<your WCS IP-address or domain name>:8443 failed (status DISCONNECTED): the back-end server answered "403 Forbidden" to your request.

6. We pass additional parameters for authorization to the createSession function (edit JS file screen-sharing.js add custom data; for example, usernameTest and passwdTest):
Code:
/usr/local/FlashphonerWebCallServer/client2/examples/demo/streaming/screen-sharing/screen-sharing.js
Code:
function start() {
  ...
    Flashphoner.createSession({urlServer: url,custom:{usernameTest: "passwdTest"}}).on(SESSION_STATUS.ESTABLISHED,function(session){...})
    ...
}
7. Complement php-script created in step 2 data for user authentication:
PHP:
<?php
$incoming_data = json_decode(file_get_contents('php://input'), true);

if ($incoming_data['custom']['usernameTest'] == 'passwdTest') {
    header('HTTP/1.1 200 OK',true,200);
} else {
    header('HTTP/1.1 403 Forbidden',true,403);
}
?>
8. Open this page in browser:
Code:
https://<your WCS IP-address or domain name>:8444/client2/examples/demo/streaming/screen-sharing/screen-sharing.html
Connection to wss://<your WCS IP-address or domain name>:8443 completed (status ESTABLISHED): the back-end server answered "200 OK" to your request.

i want to restrict user by their password and create a new token every time login and that token is sent via wcs server to authecation server. and depending to this tocken authentication server send status code 200 for ok or denied by 403 status
You should implement this on your back-end.
 
Last edited:

gurmeet

Member
update app -l "http://localhost:8081/apps/EchoApp" defaultApp
after gatting same problem then restart server again same problem
then decide to update new url below one
update app -l "http://139.162.213.9/site" defaultApp
after that screen sharing stop and got this error

tail -f /usr/local/FlashphonerWebCallServer/logs/server_logs/flashphoner.log
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.flashphoner.server.client.handler.HandlerUtils.lambda$processThroughREST$0(Unknown Source)
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
06:45:35,469 INFO RestClient - API-ASYNC-pool-12-thread-2 Method StreamStatusEvent not available for app defaultApp
 

gurmeet

Member
sir sir sir please read carefully
i dont want to atuhentication while i start screen sharing
i want to aply authentication on. when i start screen sharing and my user want to see that screen sharing (video) then he have to authenticate first then he can saw video
of screen sharing
 

Max

Administrator
Staff member
Regarding authentication.
This is how you can proceed.

1. Please arrange a code on your back-end
http://mycompany.com/wcs-api/connect
http://mycompany.com/wcs-api/playStream
...
Each URL should accept POST application/json and respond with HTTP 200 OK
The /connect URL should reply exactly received body. It should work as a mirror.

2. Test your back-end using a REST client
Each URL should work:
http://mycompany.com/wcs-api/xyz
http://mycompany.com/wcs-api/1123123

Once it is done, you will be able to switch WCS to http://mycompany.com/wcs-api
Please provide back-end working URLs. We will validate.
 

gurmeet

Member
can you provide me player.js and flashphoner js without gui format i want to implement this my existing application
or angular 6 ready client
 

Max

Administrator
Staff member
Good day.
The GUI format is not required to implement the Player example in your application.
Functions of plaeyr.js are well explained in this document and you can customize this example for your application.
In addition, parameters can be added, for example, via HTTP:
1. Publish stream on your server, for example teststream:
Code:
https://<your WCS domain name>:8443/client2/examples/demo/streaming/two_way_streaming/two_way_streaming.html
2. Play this stream:
Code:
https://<your WCS domain name>:8443/client2/examples/demo/streaming/player/player.html?streamName=teststream&autoplay=true
You can use the Embed Player example, which forms example player for placement in iframe on another website (it will connect to urlServer=wss://<your WCS domain name>:8443).
Code:
https://<your WCS domain name>:8443/client2/examples/demo/streaming/embed_player/sample.html
WebSDK documentation is available on this page.
 
Top