using red5-client to call server functions

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

using red5-client to call server functions

Juan Diego
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Rajdeep Rath

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Juan Diego
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Rajdeep Rath

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Juan Diego
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Rajdeep Rath

Welcome ☺️


On Nov 11, 2016 2:23 AM, "Juan Diego" <[hidden email]> wrote:
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Juan Diego
Hi

I am having trouble with the example you gave me, I have this code

client.connect("localhost", 1935, "myApp", new IPendingServiceCallback() {
            @Override
            public void resultReceived(IPendingServiceCall result) {
                System.out.println("resultReceived: " + result);
                ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                String code = (String) map.get("code");
                System.out.printf("Response code: %s\n", code);
                if ("NetConnection.Connect.Rejected".equals(code)) {
                    System.out.printf("Rejected: %s\n", map.get("description"));
                    client.disconnect();
                } else if ("NetConnection.Connect.Success".equals(code)) {
                    System.out.println("success: " + result.isSuccess());
                   
                    Object[] params = null;
                    //Object[] params = { "64", "cc-video-processed/" };
                    client.invoke("getLiveStreams", params, new IPendingServiceCallback() {
                        @Override
                        public void resultReceived(IPendingServiceCall result) {
                            System.out.println("resultados");
                            System.out.println(result);
                            //streams = result;
                        }
                    });
                }
            }
        });

It seems  to connects I get his on my logs on my wildfly

9:22:35.381 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 application ramona connectCallback ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3
19:22:35.382 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 connect - params: {app=ramona, tcUrl=rtmp://localhost:1935/ramona, audioCodecs=3575, path=ramona, capabilities=15, videoFunction=1, swfUrl=null, flashVer=WIN 11,2,202,235, videoCodecs=252, pageUrl=null, objectEncoding=0, fpad=false} callback: ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3 args: null
19:22:35.383 [main] INFO org.red5.client.net.rtmp.BaseRTMPClientHandler - rtmp://localhost:1935/ramona
19:22:35.447 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session created
19:22:35.465 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
19:22:35.467 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - Generated session id: FLLGLNFW2XO1X
19:22:35.490 [NioProcessor-2] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService
19:22:35.748 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session opened
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - generateClientRequest1
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - Client digest position offset: 1294 algorithm: 1

But I dont see anything on the side of the Red5 server, I dont see any of the logs saying connection reject or connection succesfull or the function "getLiveStreams"


Thanks,


On Thu, Nov 10, 2016 at 3:54 PM, Rajdeep Rath <[hidden email]> wrote:

Welcome ☺️


On Nov 11, 2016 2:23 AM, "Juan Diego" <[hidden email]> wrote:
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Juan Diego
Ok, I kind of got it working looking at the old test file on github

On Tue, Nov 15, 2016 at 8:29 PM, Juan Diego <[hidden email]> wrote:
Hi

I am having trouble with the example you gave me, I have this code

client.connect("localhost", 1935, "myApp", new IPendingServiceCallback() {
            @Override
            public void resultReceived(IPendingServiceCall result) {
                System.out.println("resultReceived: " + result);
                ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                String code = (String) map.get("code");
                System.out.printf("Response code: %s\n", code);
                if ("NetConnection.Connect.Rejected".equals(code)) {
                    System.out.printf("Rejected: %s\n", map.get("description"));
                    client.disconnect();
                } else if ("NetConnection.Connect.Success".equals(code)) {
                    System.out.println("success: " + result.isSuccess());
                   
                    Object[] params = null;
                    //Object[] params = { "64", "cc-video-processed/" };
                    client.invoke("getLiveStreams", params, new IPendingServiceCallback() {
                        @Override
                        public void resultReceived(IPendingServiceCall result) {
                            System.out.println("resultados");
                            System.out.println(result);
                            //streams = result;
                        }
                    });
                }
            }
        });

It seems  to connects I get his on my logs on my wildfly

9:22:35.381 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 application ramona connectCallback ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3
19:22:35.382 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 connect - params: {app=ramona, tcUrl=rtmp://localhost:1935/ramona, audioCodecs=3575, path=ramona, capabilities=15, videoFunction=1, swfUrl=null, flashVer=WIN 11,2,202,235, videoCodecs=252, pageUrl=null, objectEncoding=0, fpad=false} callback: ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3 args: null
19:22:35.383 [main] INFO org.red5.client.net.rtmp.BaseRTMPClientHandler - rtmp://localhost:1935/ramona
19:22:35.447 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session created
19:22:35.465 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
19:22:35.467 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - Generated session id: FLLGLNFW2XO1X
19:22:35.490 [NioProcessor-2] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService
19:22:35.748 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session opened
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - generateClientRequest1
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - Client digest position offset: 1294 algorithm: 1

But I dont see anything on the side of the Red5 server, I dont see any of the logs saying connection reject or connection succesfull or the function "getLiveStreams"


Thanks,


On Thu, Nov 10, 2016 at 3:54 PM, Rajdeep Rath <[hidden email]> wrote:

Welcome ☺️


On Nov 11, 2016 2:23 AM, "Juan Diego" <[hidden email]> wrote:
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Rajdeep Rath

Great !! Thanks for the reply. Good that you got it. Else I could have looked into it not before Saturday ☺️


On Nov 16, 2016 10:25 PM, "Juan Diego" <[hidden email]> wrote:
Ok, I kind of got it working looking at the old test file on github

On Tue, Nov 15, 2016 at 8:29 PM, Juan Diego <[hidden email]> wrote:
Hi

I am having trouble with the example you gave me, I have this code

client.connect("localhost", 1935, "myApp", new IPendingServiceCallback() {
            @Override
            public void resultReceived(IPendingServiceCall result) {
                System.out.println("resultReceived: " + result);
                ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                String code = (String) map.get("code");
                System.out.printf("Response code: %s\n", code);
                if ("NetConnection.Connect.Rejected".equals(code)) {
                    System.out.printf("Rejected: %s\n", map.get("description"));
                    client.disconnect();
                } else if ("NetConnection.Connect.Success".equals(code)) {
                    System.out.println("success: " + result.isSuccess());
                   
                    Object[] params = null;
                    //Object[] params = { "64", "cc-video-processed/" };
                    client.invoke("getLiveStreams", params, new IPendingServiceCallback() {
                        @Override
                        public void resultReceived(IPendingServiceCall result) {
                            System.out.println("resultados");
                            System.out.println(result);
                            //streams = result;
                        }
                    });
                }
            }
        });

It seems  to connects I get his on my logs on my wildfly

9:22:35.381 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 application ramona connectCallback ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3
19:22:35.382 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 connect - params: {app=ramona, tcUrl=rtmp://localhost:1935/ramona, audioCodecs=3575, path=ramona, capabilities=15, videoFunction=1, swfUrl=null, flashVer=WIN 11,2,202,235, videoCodecs=252, pageUrl=null, objectEncoding=0, fpad=false} callback: ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3 args: null
19:22:35.383 [main] INFO org.red5.client.net.rtmp.BaseRTMPClientHandler - rtmp://localhost:1935/ramona
19:22:35.447 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session created
19:22:35.465 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
19:22:35.467 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - Generated session id: FLLGLNFW2XO1X
19:22:35.490 [NioProcessor-2] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService
19:22:35.748 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session opened
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - generateClientRequest1
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - Client digest position offset: 1294 algorithm: 1

But I dont see anything on the side of the Red5 server, I dont see any of the logs saying connection reject or connection succesfull or the function "getLiveStreams"


Thanks,


On Thu, Nov 10, 2016 at 3:54 PM, Rajdeep Rath <[hidden email]> wrote:

Welcome ☺️


On Nov 11, 2016 2:23 AM, "Juan Diego" <[hidden email]> wrote:
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Juan Diego
I am not quit clear on how to get the results returned from my callback, it seems to work I am getting this

13:13:00.680 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Service name: _result args[0]: [red5StreamDemo, jdc]
13:13:00.680 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Received result for pending call - Service: null Method: getLiveStreams No params
Service: null Method: getLiveStreams No params,

In client.invoke there is a line System.out.println(result); that prints

Service: null Method: getLiveStreams No params,
.

I am just asking for a list of live streams, I am asuming there is a point where objects are returned and I have to turn them into List of Strings.

Thanks,

Juan Diego

On Wed, Nov 16, 2016 at 11:57 AM, Rajdeep Rath <[hidden email]> wrote:

Great !! Thanks for the reply. Good that you got it. Else I could have looked into it not before Saturday ☺️


On Nov 16, 2016 10:25 PM, "Juan Diego" <[hidden email]> wrote:
Ok, I kind of got it working looking at the old test file on github

On Tue, Nov 15, 2016 at 8:29 PM, Juan Diego <[hidden email]> wrote:
Hi

I am having trouble with the example you gave me, I have this code

client.connect("localhost", 1935, "myApp", new IPendingServiceCallback() {
            @Override
            public void resultReceived(IPendingServiceCall result) {
                System.out.println("resultReceived: " + result);
                ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                String code = (String) map.get("code");
                System.out.printf("Response code: %s\n", code);
                if ("NetConnection.Connect.Rejected".equals(code)) {
                    System.out.printf("Rejected: %s\n", map.get("description"));
                    client.disconnect();
                } else if ("NetConnection.Connect.Success".equals(code)) {
                    System.out.println("success: " + result.isSuccess());
                   
                    Object[] params = null;
                    //Object[] params = { "64", "cc-video-processed/" };
                    client.invoke("getLiveStreams", params, new IPendingServiceCallback() {
                        @Override
                        public void resultReceived(IPendingServiceCall result) {
                            System.out.println("resultados");
                            System.out.println(result);
                            //streams = result;
                        }
                    });
                }
            }
        });

It seems  to connects I get his on my logs on my wildfly

9:22:35.381 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 application ramona connectCallback ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3
19:22:35.382 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 connect - params: {app=ramona, tcUrl=rtmp://localhost:1935/ramona, audioCodecs=3575, path=ramona, capabilities=15, videoFunction=1, swfUrl=null, flashVer=WIN 11,2,202,235, videoCodecs=252, pageUrl=null, objectEncoding=0, fpad=false} callback: ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3 args: null
19:22:35.383 [main] INFO org.red5.client.net.rtmp.BaseRTMPClientHandler - rtmp://localhost:1935/ramona
19:22:35.447 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session created
19:22:35.465 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
19:22:35.467 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - Generated session id: FLLGLNFW2XO1X
19:22:35.490 [NioProcessor-2] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService
19:22:35.748 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session opened
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - generateClientRequest1
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - Client digest position offset: 1294 algorithm: 1

But I dont see anything on the side of the Red5 server, I dont see any of the logs saying connection reject or connection succesfull or the function "getLiveStreams"


Thanks,


On Thu, Nov 10, 2016 at 3:54 PM, Rajdeep Rath <[hidden email]> wrote:

Welcome ☺️


On Nov 11, 2016 2:23 AM, "Juan Diego" <[hidden email]> wrote:
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Rajdeep Rath

Where is that method ? GetLiveStreams ? I don't recall any such method in the application adapter by default unless you coded one.

Are you using red5 open source or pro ?


On Nov 16, 2016 11:51 PM, "Juan Diego" <[hidden email]> wrote:
I am not quit clear on how to get the results returned from my callback, it seems to work I am getting this

13:13:00.680 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Service name: _result args[0]: [red5StreamDemo, jdc]
13:13:00.680 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Received result for pending call - Service: null Method: getLiveStreams No params
Service: null Method: getLiveStreams No params,

In client.invoke there is a line System.out.println(result); that prints

Service: null Method: getLiveStreams No params,
.

I am just asking for a list of live streams, I am asuming there is a point where objects are returned and I have to turn them into List of Strings.

Thanks,

Juan Diego

On Wed, Nov 16, 2016 at 11:57 AM, Rajdeep Rath <[hidden email]> wrote:

Great !! Thanks for the reply. Good that you got it. Else I could have looked into it not before Saturday ☺️


On Nov 16, 2016 10:25 PM, "Juan Diego" <[hidden email]> wrote:
Ok, I kind of got it working looking at the old test file on github

On Tue, Nov 15, 2016 at 8:29 PM, Juan Diego <[hidden email]> wrote:
Hi

I am having trouble with the example you gave me, I have this code

client.connect("localhost", 1935, "myApp", new IPendingServiceCallback() {
            @Override
            public void resultReceived(IPendingServiceCall result) {
                System.out.println("resultReceived: " + result);
                ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                String code = (String) map.get("code");
                System.out.printf("Response code: %s\n", code);
                if ("NetConnection.Connect.Rejected".equals(code)) {
                    System.out.printf("Rejected: %s\n", map.get("description"));
                    client.disconnect();
                } else if ("NetConnection.Connect.Success".equals(code)) {
                    System.out.println("success: " + result.isSuccess());
                   
                    Object[] params = null;
                    //Object[] params = { "64", "cc-video-processed/" };
                    client.invoke("getLiveStreams", params, new IPendingServiceCallback() {
                        @Override
                        public void resultReceived(IPendingServiceCall result) {
                            System.out.println("resultados");
                            System.out.println(result);
                            //streams = result;
                        }
                    });
                }
            }
        });

It seems  to connects I get his on my logs on my wildfly

9:22:35.381 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 application ramona connectCallback ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3
19:22:35.382 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 connect - params: {app=ramona, tcUrl=rtmp://localhost:1935/ramona, audioCodecs=3575, path=ramona, capabilities=15, videoFunction=1, swfUrl=null, flashVer=WIN 11,2,202,235, videoCodecs=252, pageUrl=null, objectEncoding=0, fpad=false} callback: ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3 args: null
19:22:35.383 [main] INFO org.red5.client.net.rtmp.BaseRTMPClientHandler - rtmp://localhost:1935/ramona
19:22:35.447 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session created
19:22:35.465 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
19:22:35.467 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - Generated session id: FLLGLNFW2XO1X
19:22:35.490 [NioProcessor-2] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService
19:22:35.748 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session opened
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - generateClientRequest1
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - Client digest position offset: 1294 algorithm: 1

But I dont see anything on the side of the Red5 server, I dont see any of the logs saying connection reject or connection succesfull or the function "getLiveStreams"


Thanks,


On Thu, Nov 10, 2016 at 3:54 PM, Rajdeep Rath <[hidden email]> wrote:

Welcome ☺️


On Nov 11, 2016 2:23 AM, "Juan Diego" <[hidden email]> wrote:
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Juan Diego
Lol sorry, I created getLiveStreams on my red5app based on this https://www.red5pro.com/docs/server/red5prolive/, I am using red5 open source.  So from my java app I am doing the following

List<String> streams;
Thread t = new Thread(new Runnable() {
            public void run() {
                client.connect(host, port, red5App, new IPendingServiceCallback() {
                    @Override
                    public void resultReceived(IPendingServiceCall result) {
                        System.out.println("resultReceived: " + result);
                        ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                        String code = (String) map.get("code");
                        System.out.printf("Response code: %s\n", code);
                        if ("NetConnection.Connect.Rejected".equals(code)) {
                            System.out.printf("Rejected: %s\n", map.get("description"));
                            client.disconnect();
                        } else if ("NetConnection.Connect.Success".equals(code)) {
                            System.out.println("success: " + result.isSuccess());
                            client.invoke("getLiveStreams",new IPendingServiceCallback() {
                                @Override
                                public void resultReceived(IPendingServiceCall result) {
                                    System.out.println(result);
                                    //streams = (List<String>)result.getResult();
                                }
                            });
                           
                        }
                    }
                });
            }

        });
       
        t.start();
        t.join(60000L);
        Thread.sleep(1000L);

        client.disconnect();

In this method I am invoking getLiveStreams as you can see.  I have a list called "streams" which is where I want to store the list of my streams retrieved from my red5app, but I think I am getting a String which contains the streams all together.
I see this line
13:33:52.787 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Service name: _result args[0]: [red5StreamDemo, jdc]

I can see on the debug logs that at some point i am getting the name of the Streams that are running on my red5 server, but I have no clue in how to put them on a list. How do I do something like
List<String> streams = (List<String) callback.getResulst() or something like that.


On Wed, Nov 16, 2016 at 1:24 PM, Rajdeep Rath <[hidden email]> wrote:

Where is that method ? GetLiveStreams ? I don't recall any such method in the application adapter by default unless you coded one.

Are you using red5 open source or pro ?


On Nov 16, 2016 11:51 PM, "Juan Diego" <[hidden email]> wrote:
I am not quit clear on how to get the results returned from my callback, it seems to work I am getting this

13:13:00.680 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Service name: _result args[0]: [red5StreamDemo, jdc]
13:13:00.680 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Received result for pending call - Service: null Method: getLiveStreams No params
Service: null Method: getLiveStreams No params,

In client.invoke there is a line System.out.println(result); that prints

Service: null Method: getLiveStreams No params,
.

I am just asking for a list of live streams, I am asuming there is a point where objects are returned and I have to turn them into List of Strings.

Thanks,

Juan Diego

On Wed, Nov 16, 2016 at 11:57 AM, Rajdeep Rath <[hidden email]> wrote:

Great !! Thanks for the reply. Good that you got it. Else I could have looked into it not before Saturday ☺️


On Nov 16, 2016 10:25 PM, "Juan Diego" <[hidden email]> wrote:
Ok, I kind of got it working looking at the old test file on github

On Tue, Nov 15, 2016 at 8:29 PM, Juan Diego <[hidden email]> wrote:
Hi

I am having trouble with the example you gave me, I have this code

client.connect("localhost", 1935, "myApp", new IPendingServiceCallback() {
            @Override
            public void resultReceived(IPendingServiceCall result) {
                System.out.println("resultReceived: " + result);
                ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                String code = (String) map.get("code");
                System.out.printf("Response code: %s\n", code);
                if ("NetConnection.Connect.Rejected".equals(code)) {
                    System.out.printf("Rejected: %s\n", map.get("description"));
                    client.disconnect();
                } else if ("NetConnection.Connect.Success".equals(code)) {
                    System.out.println("success: " + result.isSuccess());
                   
                    Object[] params = null;
                    //Object[] params = { "64", "cc-video-processed/" };
                    client.invoke("getLiveStreams", params, new IPendingServiceCallback() {
                        @Override
                        public void resultReceived(IPendingServiceCall result) {
                            System.out.println("resultados");
                            System.out.println(result);
                            //streams = result;
                        }
                    });
                }
            }
        });

It seems  to connects I get his on my logs on my wildfly

9:22:35.381 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 application ramona connectCallback ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3
19:22:35.382 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 connect - params: {app=ramona, tcUrl=rtmp://localhost:1935/ramona, audioCodecs=3575, path=ramona, capabilities=15, videoFunction=1, swfUrl=null, flashVer=WIN 11,2,202,235, videoCodecs=252, pageUrl=null, objectEncoding=0, fpad=false} callback: ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3 args: null
19:22:35.383 [main] INFO org.red5.client.net.rtmp.BaseRTMPClientHandler - rtmp://localhost:1935/ramona
19:22:35.447 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session created
19:22:35.465 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
19:22:35.467 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - Generated session id: FLLGLNFW2XO1X
19:22:35.490 [NioProcessor-2] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService
19:22:35.748 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session opened
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - generateClientRequest1
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - Client digest position offset: 1294 algorithm: 1

But I dont see anything on the side of the Red5 server, I dont see any of the logs saying connection reject or connection succesfull or the function "getLiveStreams"


Thanks,


On Thu, Nov 10, 2016 at 3:54 PM, Rajdeep Rath <[hidden email]> wrote:

Welcome ☺️


On Nov 11, 2016 2:23 AM, "Juan Diego" <[hidden email]> wrote:
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: using red5-client to call server functions

Rajdeep Rath

That example to get live streams may not be quiet compatible with the open source version if red5. Let me see if I can get you something ... But you need to wait till Monday. ☺️


On Nov 17, 2016 12:09 AM, "Juan Diego" <[hidden email]> wrote:
Lol sorry, I created getLiveStreams on my red5app based on this https://www.red5pro.com/docs/server/red5prolive/, I am using red5 open source.  So from my java app I am doing the following

List<String> streams;
Thread t = new Thread(new Runnable() {
            public void run() {
                client.connect(host, port, red5App, new IPendingServiceCallback() {
                    @Override
                    public void resultReceived(IPendingServiceCall result) {
                        System.out.println("resultReceived: " + result);
                        ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                        String code = (String) map.get("code");
                        System.out.printf("Response code: %s\n", code);
                        if ("NetConnection.Connect.Rejected".equals(code)) {
                            System.out.printf("Rejected: %s\n", map.get("description"));
                            client.disconnect();
                        } else if ("NetConnection.Connect.Success".equals(code)) {
                            System.out.println("success: " + result.isSuccess());
                            client.invoke("getLiveStreams",new IPendingServiceCallback() {
                                @Override
                                public void resultReceived(IPendingServiceCall result) {
                                    System.out.println(result);
                                    //streams = (List<String>)result.getResult();
                                }
                            });
                           
                        }
                    }
                });
            }

        });
       
        t.start();
        t.join(60000L);
        Thread.sleep(1000L);

        client.disconnect();

In this method I am invoking getLiveStreams as you can see.  I have a list called "streams" which is where I want to store the list of my streams retrieved from my red5app, but I think I am getting a String which contains the streams all together.
I see this line
13:33:52.787 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Service name: _result args[0]: [red5StreamDemo, jdc]

I can see on the debug logs that at some point i am getting the name of the Streams that are running on my red5 server, but I have no clue in how to put them on a list. How do I do something like
List<String> streams = (List<String) callback.getResulst() or something like that.


On Wed, Nov 16, 2016 at 1:24 PM, Rajdeep Rath <[hidden email]> wrote:

Where is that method ? GetLiveStreams ? I don't recall any such method in the application adapter by default unless you coded one.

Are you using red5 open source or pro ?


On Nov 16, 2016 11:51 PM, "Juan Diego" <[hidden email]> wrote:
I am not quit clear on how to get the results returned from my callback, it seems to work I am getting this

13:13:00.680 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Service name: _result args[0]: [red5StreamDemo, jdc]
13:13:00.680 [ThreadPoolTaskExecutor-1] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - Received result for pending call - Service: null Method: getLiveStreams No params
Service: null Method: getLiveStreams No params,

In client.invoke there is a line System.out.println(result); that prints

Service: null Method: getLiveStreams No params,
.

I am just asking for a list of live streams, I am asuming there is a point where objects are returned and I have to turn them into List of Strings.

Thanks,

Juan Diego

On Wed, Nov 16, 2016 at 11:57 AM, Rajdeep Rath <[hidden email]> wrote:

Great !! Thanks for the reply. Good that you got it. Else I could have looked into it not before Saturday ☺️


On Nov 16, 2016 10:25 PM, "Juan Diego" <[hidden email]> wrote:
Ok, I kind of got it working looking at the old test file on github

On Tue, Nov 15, 2016 at 8:29 PM, Juan Diego <[hidden email]> wrote:
Hi

I am having trouble with the example you gave me, I have this code

client.connect("localhost", 1935, "myApp", new IPendingServiceCallback() {
            @Override
            public void resultReceived(IPendingServiceCall result) {
                System.out.println("resultReceived: " + result);
                ObjectMap<?, ?> map = (ObjectMap<?, ?>) result.getResult();
                String code = (String) map.get("code");
                System.out.printf("Response code: %s\n", code);
                if ("NetConnection.Connect.Rejected".equals(code)) {
                    System.out.printf("Rejected: %s\n", map.get("description"));
                    client.disconnect();
                } else if ("NetConnection.Connect.Success".equals(code)) {
                    System.out.println("success: " + result.isSuccess());
                   
                    Object[] params = null;
                    //Object[] params = { "64", "cc-video-processed/" };
                    client.invoke("getLiveStreams", params, new IPendingServiceCallback() {
                        @Override
                        public void resultReceived(IPendingServiceCall result) {
                            System.out.println("resultados");
                            System.out.println(result);
                            //streams = result;
                        }
                    });
                }
            }
        });

It seems  to connects I get his on my logs on my wildfly

9:22:35.381 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 application ramona connectCallback ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3
19:22:35.382 [main] DEBUG org.red5.client.net.rtmp.BaseRTMPClientHandler - connect server: localhost port 1935 connect - params: {app=ramona, tcUrl=rtmp://localhost:1935/ramona, audioCodecs=3575, path=ramona, capabilities=15, videoFunction=1, swfUrl=null, flashVer=WIN 11,2,202,235, videoCodecs=252, pageUrl=null, objectEncoding=0, fpad=false} callback: ec.com.mapachedev.service.impl.StreamServiceImpl$1@2ac273d3 args: null
19:22:35.383 [main] INFO org.red5.client.net.rtmp.BaseRTMPClientHandler - rtmp://localhost:1935/ramona
19:22:35.447 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session created
19:22:35.465 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - New BaseConnection - type: persistent
19:22:35.467 [NioProcessor-2] DEBUG org.red5.server.BaseConnection - Generated session id: FLLGLNFW2XO1X
19:22:35.490 [NioProcessor-2] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService
19:22:35.748 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.RTMPMinaIoHandler - Session opened
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - generateClientRequest1
19:22:35.749 [NioProcessor-2] DEBUG org.red5.client.net.rtmp.OutboundHandshake - Client digest position offset: 1294 algorithm: 1

But I dont see anything on the side of the Red5 server, I dont see any of the logs saying connection reject or connection succesfull or the function "getLiveStreams"


Thanks,


On Thu, Nov 10, 2016 at 3:54 PM, Rajdeep Rath <[hidden email]> wrote:

Welcome ☺️


On Nov 11, 2016 2:23 AM, "Juan Diego" <[hidden email]> wrote:
Nice thanks

On Wed, Nov 9, 2016 at 3:09 PM, Rajdeep Rath <[hidden email]> wrote:

Look at this

https://github.com/Red5/red5-client/blob/master/src/test/java/org/red5/client/net/rtmp/RTMPClientTest.java

Look at the commented method and the invoke sample. Notice how you provide it a 'callback' handler where the result is returned.


On Nov 10, 2016 1:33 AM, "Juan Diego" <[hidden email]> wrote:
How would I use those classes to use something similar to the nc.call() from flash?

On Wed, Nov 9, 2016 at 1:44 PM, Rajdeep Rath <[hidden email]> wrote:

You would normally use the red5-client project located on github.

https://github.com/Red5/red5-client

Then you would use the method invoke after making a connection to server.

Interface :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/IRTMPClient.java

Implementable class to use :

https://github.com/Red5/red5-client/blob/master/src/main/java/org/red5/client/net/rtmp/RTMPClient.java


On Nov 10, 2016 12:03 AM, "Juan Diego" <[hidden email]> wrote:
Hi,

Sorry if this is somewhere else but I get to many false positives when I search for red5-client to call on server functions,I get tons of flash nc.call examples.

So I have a site that has a backend that runs on java.  I haved used red5-client in the pass to restream/proxy to another server, but I have never called a function of my app with red5-client.

Is it possible to call functions with red5-client should I use another method?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.