Tuesday, March 8, 2016

Installing screenshare on red5 server

A client of mine asked me to install screenshare on his red5 server and I found very little resources on the subject. After successfully configuring it I decided I will share the solution so that those that come after, will spend less time that I did!!!
So to the task :
I will suppose that you already have a working red5 server. My deployment was on red5-server-1.0.6-RELEASE-server.
Now download screenshare:
Go to https://github.com/deleolajide/red5-screenshare and press "Download Zip".
Inside the zip you will find a directory webapps/screenshare. Extract this screenshare directory to your red5 server's webapps folder.
Inside the screenshare you need to edit two files.
Edit the screenshare.jnlp as follows

<?xml version='1.0' encoding='utf-8'?>
<jnlp spec='1.0+' codebase='http://localhost:5080/screenshare'>
        <title>Red5 ScreenShare</title>
        <vendor>Dele Olajide</vendor>
        <description>Red5 ScreenShare</description>
        <description kind='short'>An Open Source Screen Share Java application for Adobe Flash using Red5</description>
    <j2se version='1.6+'/>
        <jar href='screenshare.jar'/>
    <application-desc main-class='org.redfire.screen.ScreenShare'>


If you run a public server, replace localhost with your public IP.
Then edit screenviewer.html as follows (some lines are not shown since they do not contain configuration):

        var stream = getPageParameter('stream', 'screen_share');
        var url = getPageParameter('url', 'rtmp://localhost:1935/screenshare');
        var control = getPageParameter('control', 'true');

If you run a public server, replace localhost with your public IP.
And that is all.
Do not forget to add your site on java security tab or the java client will be blocked:
Then run on one PC (to share):
And on the other PC (to view):
Replace  YOUR_PUBLIC_IP with localhost to test on your pc!

If you run a server on a public IP, do not forget to open port 1935 on your server's firewall!