b-deng / red5-screenshare

Automatically exported from code.google.com/p/red5-screenshare
0 stars 0 forks source link

ScreenClientHandler - channel closed! #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have copied the screenshare folder in the webapps folder of Red5. I have 
edited the screenshare.jnlp in this way:

<?xml version='1.0' encoding='utf-8'?>
<jnlp spec='1.0+' codebase='http://localhost/screenshare'> 
    <information> 
        <title>Red5 ScreenShare</title> 
        <vendor>Dele Olajide</vendor> 
        <homepage>http://code.google.com/p/red5screnshare/</homepage>
        <description>Red5 ScreenShare</description> 
        <description kind='short'>An Open Source Screen Share Java application for Adobe Flash using Red5</description> 
        <offline-allowed/> 
    </information>
    <security>
        <all-permissions/>
    </security> 
    <resources> 
    <j2se version='1.6+'/> 
        <jar href='screenshare.jar'/> 
    </resources> 
    <application-desc main-class='org.redfire.screen.ScreenShare'>
        <argument>localhost</argument> 
        <argument>oflaDemo</argument> 
        <argument>1935</argument> 
        <argument>screen_share</argument>   
        <argument>flashsv2</argument>       
    </application-desc> 
</jnlp>

and the screenviewer.html like this:

<html>
<head>
<title>ScreenViewer</title>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">

    var screenViewer = null;

    function setupApp()
    {
        screenViewer = document.getElementById("screenViewerID");

    }

    function stopApp()
    {
        if (screenViewer != null)
        {
            screenViewer.windowCloseEvent();
        }
    }

function getParameter(string, parm, delim) {

     if (string.length == 0) {
        return '';
     }

     var sPos = string.indexOf(parm + "=");

     if (sPos == -1) {return '';}

     sPos = sPos + parm.length + 1;
     var ePos = string.indexOf(delim, sPos);

     if (ePos == -1) {
        ePos = string.length;
     }

     return unescape(string.substring(sPos, ePos));
}

function getPageParameter(parameterName, defaultValue) {

    var s = self.location.search;

    if ((s == null) || (s.length < 1)) {
        return defaultValue;
    }

    s = getParameter(s, parameterName, '&');

    if ((s == null) || (s.length < 1)) {
        s = defaultValue;
    }

    return s;
}

    </script>
</head>
<body topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0" 
onload="setupApp()" onUnload="stopApp()">
<div id="screenViewerDIV"></div>
<script type="text/javascript">

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

        fo = new SWFObject("ScreenViewer.swf?rtmpUrl=" + url + "&recieverStream=" + stream + "&control=" + control, "screenViewerID", "100%", "100%", "9");
        fo.addParam("swLiveConnect", "true");
        fo.addParam("name", "screenViewerID");
        fo.write("screenViewerDIV");
</script>
</body>
</html>

and the command I enter is:

java -classpath screenshare.jar org.redfire.screen.ScreenShare localhost 
oflademo 1935 screen_share flashsv2

Everything looks correct and according to the instructions, but as I press the 
"start Sharing" button, it does not share. The following commands are displayed 
in the console:

imgsun.awt.image.ToolkitImage@574caa3f
initialized
captureScreenStart
ScreenShare startStream
[INFO] [pool-1-thread-1] org.redfire.screen.ScreenClientHandler - channel opened
: [id: 0x3072c57f] OPEN
[INFO] [New I/O client worker #1-1] org.redfire.screen.ScreenClientHandshakeHand
ler - connected, starting handshake
[INFO] [New I/O client worker #1-1] com.flazr.rtmp.RtmpHandshake - using client
version 00000000
[INFO] [New I/O client worker #1-1] org.redfire.screen.ScreenClientHandler - han
dshake complete, sending 'connect'
[INFO] [New I/O client worker #1-1] org.redfire.screen.ScreenClientHandler - sen
ding command (expecting result): [0 COMMAND_AMF0 c3 #0 t0 (0) s0] name: connect,
 transactionId: 1, object: {app=oflademo, flashVer=WIN 9,0,124,2, tcUrl=rtmp://l
ocalhost:1935/oflademo, fpad=false, audioCodecs=1639.0, videoCodecs=252.0, objec
tEncoding=0.0, capabilities=15.0, videoFunction=1.0}, args: null
[WARN] [New I/O client worker #1-1] com.flazr.util.ChannelUtils - exception: {}
java.lang.NullPointerException
        at com.flazr.rtmp.RtmpHeader.<init>(RtmpHeader.java:104) [screenshare.ja
r:na]
        at com.flazr.rtmp.RtmpDecoder.decode(RtmpDecoder.java:59) [screenshare.j
ar:na]
        at com.flazr.rtmp.RtmpDecoder.decode(RtmpDecoder.java:33) [screenshare.j
ar:na]
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(Repl
ayingDecoder.java:454) [screenshare.jar:na]
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived
(ReplayingDecoder.java:427) [screenshare.jar:na]
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:34
5) [screenshare.jar:na]
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:33
2) [screenshare.jar:na]
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:323)
 [screenshare.jar:na]
        at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioW
orker.java:275) [screenshare.jar:na]
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:196)
[screenshare.jar:na]
        at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.j
ava:46) [screenshare.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1110) [na:1.8.0-ea]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:603) [na:1.8.0-ea]
        at java.lang.Thread.run(Thread.java:722) [na:1.8.0-ea]
[WARN] [New I/O client worker #1-1] com.flazr.util.ChannelUtils - exception: {}
java.lang.RuntimeException: bad value / byte: 117 (hex: 75), java.lang.ArrayInde
xOutOfBoundsException: 117
        at com.flazr.util.ValueToEnum.valueToEnum(ValueToEnum.java:56) [screensh
are.jar:na]
        at com.flazr.rtmp.message.MessageType.valueToEnum(MessageType.java:100)
[screenshare.jar:na]
        at com.flazr.rtmp.RtmpHeader.<init>(RtmpHeader.java:94) [screenshare.jar
:na]
        at com.flazr.rtmp.RtmpDecoder.decode(RtmpDecoder.java:59) [screenshare.j
ar:na]
        at com.flazr.rtmp.RtmpDecoder.decode(RtmpDecoder.java:33) [screenshare.j
ar:na]
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(Repl
ayingDecoder.java:454) [screenshare.jar:na]
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.cleanup(Replayi
ngDecoder.java:525) [screenshare.jar:na]
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.channelDisconne
cted(ReplayingDecoder.java:433) [screenshare.jar:na]
        at org.jboss.netty.channel.Channels.fireChannelDisconnected(Channels.jav
a:502) [screenshare.jar:na]
        at org.jboss.netty.channel.socket.nio.NioWorker.close(NioWorker.java:583
) [screenshare.jar:na]
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventS
unk(NioClientSocketPipelineSink.java:91) [screenshare.jar:na]
        at org.jboss.netty.channel.Channels.close(Channels.java:1065) [screensha
re.jar:na]
        at org.jboss.netty.channel.AbstractChannel.close(AbstractChannel.java:17
8) [screenshare.jar:na]
        at com.flazr.util.ChannelUtils.exceptionCaught(ChannelUtils.java:41) [sc
reenshare.jar:na]
        at org.redfire.screen.ScreenClientHandler.exceptionCaught(ScreenClientHa
ndler.java:327) [screenshare.jar:na]
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.exceptionCaught
(ReplayingDecoder.java:445) [screenshare.jar:na]
        at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:61
9) [screenshare.jar:na]
        at org.jboss.netty.channel.AbstractChannelSink.exceptionCaught(AbstractC
hannelSink.java:52) [screenshare.jar:na]
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:34
5) [screenshare.jar:na]
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:33
2) [screenshare.jar:na]
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:323)
 [screenshare.jar:na]
        at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioW
orker.java:275) [screenshare.jar:na]
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:196)
[screenshare.jar:na]
        at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.j
ava:46) [screenshare.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1110) [na:1.8.0-ea]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:603) [na:1.8.0-ea]
        at java.lang.Thread.run(Thread.java:722) [na:1.8.0-ea]
[INFO] [New I/O client worker #1-1] org.redfire.screen.ScreenClientHandler - cha
nnel closed: [id: 0x3072c57f, /127.0.0.1:47016 => localhost/127.0.0.1:1935] CLOS
ED

Please help me to solve the issue. It is deeply important to deploy the desktop 
sharing on my localhost and then on our server. 

Thanks in advance!

Original issue reported on code.google.com by behzadre...@gmail.com on 8 Oct 2013 at 8:10