about screensharing extension

Gabriel T

Member
Hello
is the chrome and firefox screensharing extension supposed to work ? i installed both and cant get it work using the samples in the dashboard.
also, stupid question question, are these extension also working for chrome and firefox on mac os ?

thank you
 

Max

Administrator
Staff member
The extensions are configured for usage from our domain *.flashphoner.com
Therefore if you open a page on your domain https://gabriel.com, it won't work with our extension.
To get this working you have to place your own extension built from our source code to Chrome Store and configure your extension for your domain.
Here you can find how to docs:
https://flashphoner.com/docs/wcs5/w...guide-2/index.html?screen_sharing_web_sdk.htm
is the chrome and firefox screensharing extension supposed to work ?
It should work. At least with Chrome.
However some of our clients report that it does not work with latest Firefox versions.
We suppose it is related the new Web Extension API. We are checking it now.
are these extension also working for chrome and firefox on mac os ?
Yes it should work on desktop platforms. Not tested with mobile devices yet.
 

Gabriel T

Member
working great thanks !
however i havent been able to set
viewportOffsetX: x.value,
viewportOffsetY: y.value
to define the portion of screen i want to share, is this possible ?
 

Gabriel T

Member
im trying to integrate the screensharing in the conference example with no success :/

here is what i did so far:
changed the FP init to Flashphoner.init({screenSharingExtensionId: extensionId});

when user click my start sharing button it calls the following (extension is installed and available)

function startScreenSharing() {
var interval;
if (Browser.isFirefox()) {
$("#installExtensionButton").show();
interval = setInterval(function() {
if (Flashphoner.firefoxScreenSharingExtensionInstalled) {
console.log('FF extensions available');
$("#extension").hide();
$("#installExtensionButton").hide();
clearInterval(interval);
$("#publishSDBtn").show();
publishScreenSharing();
}
}, 500);

} else if (Browser.isChrome()) {
interval = setInterval(function() {
chrome.runtime.sendMessage(extensionId, {type: "isInstalled"}, function (response) {
if (response) {
console.log('Chrome extensions available');
$("#extension").hide();
clearInterval(interval);
$("#publishSDBtn").show();
publishScreenSharing();
} else {
(inIframe()) ? $("#installFromMarket").show() : $("#installExtensionButton").show();
}
});
}, 500);

} else {
$("#notify").modal('show');
return false;
}
}

then call publishScreenSharing() (where _room is the reference to the room joined for conference)

function publishScreenSharing() {
var streamName = "SD"+_roomID;
var constraints = {
video: {
width: parseInt(window.screen.width),
height: parseInt(window.screen.height),
frameRate: parseInt(1),
type: "screen",
}
};
_room.publish({
name: streamName,
constraints: constraints,
rtmpUrl: 'rtmp://xxx.xxx.com/wcs/'+_roomID
});
}

then nothing happen, and have this warning in console:
no-flash.min.js:1 04:34:57 WARN core - TypeError: Cannot read property 'children' of undefined
at getCacheInstance (no-flash.min.js:1)
at releaseMedia (no-flash.min.js:1)
at no-flash.min.js:1
at new Promise (<anonymous>)
at Object.getMediaAccess (no-flash.min.js:1)
at Object.stream.publish (no-flash.min.js:1)
at Object.room.publish (no-flash.min.js:1)
at publishScreenSharing (visio.php:644)
at sendResponseAndClearCallback (VM1254 extensions::messaging:419)
basically im using the same _room.publish that im using to publish my webcam, am i missing something ?

thank you
 

Max

Administrator
Staff member
Hello
Firefox extension no longer working since Firefox 57.
We have to port the extension to WebExtension API. It is in our roadmap.
So with existing version you have Chrome extension working only.
 

Gabriel T

Member
yes im talking about the chrome one. finally got it working (just had to add the preview div as display)
however i still dont get the result i want as streamname is not used, and the publish method just use the same streamname as the webcam. is it mandatory to use "createStream" instead of "publish" if i want to define a custom name for the stream ?
 

Gabriel T

Member
finally implemented it with session.createStream to have controll on streamName, but while its working with the demo, it is not on my app: the preview appears 1/2 second then, and stream status return failed.
here are server logs:
11:43:57,536 INFO agerRemoteRmiService - RMI TCP Connection(262)-46.105.105.227 SEND REST OBJECT ==>
URL:http://localhost:9091/RoomApp/publishStream
OBJECT:
{
"nodeId" : "OuGGlbBea8u8AP0ZIgnCCfTGsoCqwT9C@46.105.105.227",
"appKey" : "roomApp",
"sessionId" : "/223.207.146.219:49350/46.105.105.227:8443",
"mediaSessionId" : "0020c530-21f2-11e8-8f18-3300bac48b14",
"name" : "SD1",
"published" : true,
"hasVideo" : true,
"hasAudio" : false,
"status" : "PENDING",
"record" : false,
"width" : 0,
"height" : 0,
"bitrate" : 0,
"quality" : 0,
"rtmpUrl" : "rtmp://visio1.xxx.com/wcs/1",
"mediaProvider" : "WebRTC",
"history" : false,
"origin" : "https://visio-2.xxx.com",
"constraints" : {
"video" : {
"mandatory" : {
"maxWidth" : 1920,
"maxHeight" : 1080,
"maxFrameRate" : 1,
"chromeMediaSource" : "desktop",
"chromeMediaSourceId" : "Z4izUoI94vlWc7+1mGLCWQ=="
}
}
}
}
11:43:57,541 INFO RoomApp - http-nio-9091-exec-6 Try to use room name SD1
11:43:57,543 WARN RestTemplate - RMI TCP Connection(262)-46.105.105.227 POST request for "http://localhost:9091/RoomApp/publishStream" resulted in 500 (Internal Server Error); invoking error handler
11:43:57,563 INFO agerRemoteRmiService - RMI TCP Connection(262)-46.105.105.227 SEND REST OBJECT ==>
URL:http://localhost:9091/RoomApp/StreamStatusEvent
OBJECT:
{
"nodeId" : "OuGGlbBea8u8AP0ZIgnCCfTGsoCqwT9C@46.105.105.227",
"appKey" : "roomApp",
"sessionId" : "/223.207.146.219:49350/46.105.105.227:8443",
"status" : "FAILED",
"info" : "com.flashphoner.server.commons.rmi.operations.exception.RestResponseException: Internal Server Error"
}
11:43:57,569 INFO agerRemoteRmiService - RMI TCP Connection(262)-46.105.105.227 RECEIVED REST OBJECT <==
URL:http://localhost:9091/RoomApp/StreamStatusEvent
OBJECT:
{
"nodeId" : "OuGGlbBea8u8AP0ZIgnCCfTGsoCqwT9C@46.105.105.227",
"appKey" : "roomApp",
"sessionId" : "/223.207.146.219:49350/46.105.105.227:8443",
"status" : "FAILED",
"info" : "com.flashphoner.server.commons.rmi.operations.exception.RestResponseException: Internal Server Error"

maybe its related to this line: 11:43:57,541 INFO RoomApp - http-nio-9091-exec-6 Try to use room name SD1
SD1 is supposed to be the stream name, not the room name...any clue ?
thanks
 
Last edited:

Max

Administrator
Staff member
Try to search over
resulted in 500 (Internal Server Error)
in flashphoner_manager.log
It is the reason why stream does not work. Need stack trace.
 

Max

Administrator
Staff member
Could you also please place further logs under Spoiler (Insert icon)
11:43:57,569 INFO agerRemoteRmiService - RMI TCP Connection(262)-46.105.105.227 RECEIVED REST OBJECT <==
URL:http://localhost:9091/RoomApp/StreamStatusEvent
OBJECT:
{
"nodeId" : "OuGGlbBea8u8AP0ZIgnCCfTGsoCqwT9C@46.105.105.227",
"appKey" : "roomApp",
"sessionId" : "/223.207.146.219:49350/46.105.105.227:8443",
"status" : "FAILED",
"info" : "com.flashphoner.server.commons.rmi.operations.exception.RestResponseException: Internal Server Error"
 

Gabriel T

Member
i've edited my previous post to add logs in spoiler. these are the full logs from flashphoner_manager, dont have any other info about the error 500...
 

Gabriel T

Member
ok, so 2 things:
first it appears that chrome extension can now be ported to FF directly. i tryed and it works. just need to add this in the manifest:
"applications": {
"gecko": {
"id": "email@yourdomain.com"
}
},
make your zip, add it in addons.firefox and see the magic
just if (Flashphoner.firefoxScreenSharingExtensionInstalled) is not working properly anymore, so i dont know how to check if FF extension is installed. any advice welcome
second, coming back to my publishing error:
if i change the stream name from "SD1" to "1", not server 500 error and publishing is working as expected...strange.
as a reminder here is the situation:
-using the conference example, i join a room called "1" (id of the room in database)
-publishing using session.createStream, where session is a reference to the session created with flashphoner
if defining "SD1" as streamName for the screensharing, error 500
if defining "1" as streamName, works as expected (but i really need my stream to be called SD1 so i can distinguish user webcam stream, and screenSharing stream. Any idea ?
 
Last edited:

Gabriel T

Member
so, according to what i understand how streams and rooms work, what i should eventually do is to join a second time the room through the same session, so i can define the username i want. not exactly what i want as i dont want this second connection to appear as a connected user but thats a workaround. that would be cool to be able to specify the stream name we want without having to join a second time
 

Gabriel T

Member
hum...creating a second connection and joining the same room with this new connection now working as expected...im stuck in my plan so far...any idea ?
 

Gabriel T

Member
finally got it working: need to create a new fp session, without joining room...perfect !
and i confirm again the chrome extension is working as expected when ported to FF. just final question: is it possible to define the part of screen we want to share ? (like defining offsetx,offsety, width, height)
 

Max

Administrator
Staff member
finally got it working: need to create a new fp session, without joining room
Yes. Room is just a context allowing other users to receive notifications related streams and connections inside the room. You can publish and play any stream outside the room.
s it possible to define the part of screen we want to share ? (like defining offsetx,offsety, width, height
We never tested selection of area. Generally you choose screen sharing window manually in UI during stream creation.
Try to check Chrome or Firefox extension API for this feature.
By the way, we have recently ported our old Screen Sharing extension for Firefox to Web Extensions API.
So you can compare your implementation with ours:
https://github.com/flashphoner/flashphoner_client/commits/wcs_api-2.0
Commits on Mar 9, 2018
 

Gabriel T

Member
the new ff extension is working fine, thanks. however it seems that only "window" can be shared, and not "screen". probably an api limitation...thank you
 

Gabriel T

Member
thanks, its working. since last update (today), new errors showing up in the logs when sharing desktop from chrome or FF (latest builds), windows 7 (but the sharing is working as expected):

06:11:42,144 WARN ControlPacket - RTP-pool-28-thread-9 Rtcp innerBlocks - 00; type not found - cf
06:11:42,144 ERROR ControlPacketDecoder - RTP-pool-28-thread-9 Failed to decode control packet

also, rtmp republishing still not working. will give a try from another windows version
 

Max

Administrator
Staff member
new errors showing up in the logs when sharing desktop from chrome or FF (latest builds), windows 7 (but the sharing is working as expected)
Thanks. We have reproduced this. Internal ticket was created WCS-1206. We will inform you about progress.
 

Max

Administrator
Staff member
Regarding RTMP re-publishing. It is working with latest build 3013.
If it does not work for you, could you please create a new thread with screenshots, settings and logs.
We will check.
Make sure you play stream with prefix, i.e. rtmp_stream1.
 
Top