Skip to content
David Maas edited this page Feb 2, 2020 · 3 revisions

How to do some given task with Red5

Introduction

Herein we cover how to do stuff with Red5.

Details

Video tutorials:

Turning on the LogFilter in Mina

The logging filter gives more insight into what I/O operations are occurring within the Mina layer.

  1. Add this node to the rtmpTransport bean entry in the conf/red5-core.xml file
    <property name="enableMinaLogFilter" value="${mina.logfilter.enable}" />
  1. Add this to your conf/red5.properties file
    mina.logfilter.enable=true
  1. Add this to your conf/logback.xml
    <logger name="org.red5.server.net.rtmp.RTMPMinaTransport">
        <level value="INFO"/>
    </logger>

You'll see entries from the logger like this:

2013-04-24 09:40:35,285 [NioProcessor-2] INFO  o.r.s.net.rtmp.RTMPMinaTransport - CREATED

Access the ApplicationAdapter

These are the various ways to access the application adapter.

  • Via Spring [http://www.newviewnetworks.com/nvnhome/blog/client/uploads/Red5_Services.swf]

  • Through an ApplicationContext

IContext context = scope.getContext(); 
ApplicationContext appCtx = context.getApplicationContext(); 
Application app = (Application) appCtx.getBean("web.handler");
  • In a Servlet or JSP
ApplicationContext appCtx = (ApplicationContext) getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
Application app = (Application) appCtx.getBean("web.handler");
  • Using the ApplicationContextAware interface
this.application = (Application) appCtx.getBean("web.handler"); 
  • Via PHP running within Red5
<?
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.WebApplicationContext;

$session = $request->getSession(true);
$ctx = $session->getServletContext();
$appCtx = $ctx->getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
?>

This option uses Quercus. Blog post: PHP in Red5

####labels applicationadapter, php, servlet, application