Categories

Archives

iOS applications and Wowza Media Server integration

A few weeks ago we released a communication library for iOS which provides an excellent mechanism for integrating iOS applications with various server-side technologies. The library enables client-server integration via the RTMP protocol and thus requires the server-side code to be deployed into an RTMP. (Btw, we’re working on adding support for basic RPC (remote procedure call) mechanism which make it trivially simple to connect iOS applications with any Java, .NET or PHP class, web service, Spring beans, .NET WCF service, etc). One of the servers the library supports is Wowza Media Server. The video below provides a demonstration of the integration between iOS and Java classes deployed in Wowza. The examples demonstrate the following:

  • Invocation of Java methods from iPhone
  • Java data push via an invocation of the Objective C method from Java
  • Usage of Remote Shared Objects hosted in Wowza Media Server

The rest of this post (below the video) provides details on deploying the same examples in your own environment. We also plan to post similar videos and instructions for other RTMP server implementations, specifically FMS, Red5 and our own WebORB for Java and WebORB for .NET.

Follow the steps below to configure and run the same examples as shown in the video above (disclaimer: I’m not a Wowza Media Server expert and there might be a simpler way to do the configuration/deployment described below. If you know of a simpler or more appropriate way, please submit a comment):

  1. Download and install Wowza Media Server
  2. Create “ios” folder under [wowza-install-dir]/applications
  3. Create “ios” folder under [wowza-install-dir]/conf
  4. Create Application.xml file in [wowza-install-dir]/conf/ios with the following contents:
    <br />
    &lt;Root&gt;<br />
      &lt;Application&gt;<br />
        &lt;Connections&gt;<br />
          &lt;AutoAccept&gt;true&lt;/AutoAccept&gt;<br />
          &lt;AllowDomains&gt;&lt;/AllowDomains&gt;<br />
        &lt;/Connections&gt;<br />
        &lt;SharedObjects&gt;<br />
          &lt;StorageDir&gt;&lt;/StorageDir&gt;<br />
        &lt;/SharedObjects&gt;<br />
        &lt;Client&gt;<br />
          &lt;IdleFrequency&gt;-1&lt;/IdleFrequency&gt;<br />
          &lt;Access&gt;<br />
            &lt;StreamReadAccess&gt;*&lt;/StreamReadAccess&gt;<br />
            &lt;StreamWriteAccess&gt;*&lt;/StreamWriteAccess&gt;<br />
            &lt;StreamAudioSampleAccess&gt;&lt;/StreamAudioSampleAccess&gt;<br />
            &lt;StreamVideoSampleAccess&gt;&lt;/StreamVideoSampleAccess&gt;<br />
            &lt;SharedObjectReadAccess&gt;*&lt;/SharedObjectReadAccess&gt;<br />
            &lt;SharedObjectWriteAccess&gt;*&lt;/SharedObjectWriteAccess&gt;<br />
          &lt;/Access&gt;<br />
        &lt;/Client&gt;<br />
        &lt;Modules&gt;<br />
          &lt;Module&gt;<br />
            &lt;Name&gt;MyModule&lt;/Name&gt;<br />
            &lt;Description&gt;This is MyModule&lt;/Description&gt;<br />
            &lt;Class&gt;examples.weborb.ios.MyWowzaModule&lt;/Class&gt;<br />
          &lt;/Module&gt;<br />
        &lt;/Modules&gt;<br />
      &lt;/Application&gt;<br />
    &lt;/Root&gt;<br />
    
  5. Create “CallbackDemo” folder under [wowza-install-dir]/applications
  6. Create “CallbackDemo” folder under [wowza-install-dir]/conf
  7. Create the Application.xml file in [wowza-install-dir]/conf/CallbackDemo with the following contents:
    <br />
    &lt;Root&gt;<br />
      &lt;Application&gt;<br />
        &lt;Connections&gt;<br />
          &lt;AutoAccept&gt;true&lt;/AutoAccept&gt;<br />
          &lt;AllowDomains&gt;&lt;/AllowDomains&gt;<br />
        &lt;/Connections&gt;<br />
        &lt;SharedObjects&gt;<br />
          &lt;StorageDir&gt;&lt;/StorageDir&gt;<br />
        &lt;/SharedObjects&gt;<br />
        &lt;Client&gt;<br />
          &lt;IdleFrequency&gt;-1&lt;/IdleFrequency&gt;<br />
          &lt;Access&gt;<br />
            &lt;StreamReadAccess&gt;*&lt;/StreamReadAccess&gt;<br />
            &lt;StreamWriteAccess&gt;*&lt;/StreamWriteAccess&gt;<br />
            &lt;StreamAudioSampleAccess&gt;&lt;/StreamAudioSampleAccess&gt;<br />
            &lt;StreamVideoSampleAccess&gt;&lt;/StreamVideoSampleAccess&gt;<br />
            &lt;SharedObjectReadAccess&gt;*&lt;/SharedObjectReadAccess&gt;<br />
            &lt;SharedObjectWriteAccess&gt;*&lt;/SharedObjectWriteAccess&gt;<br />
          &lt;/Access&gt;<br />
        &lt;/Client&gt;<br />
        &lt;Modules&gt;<br />
          &lt;Module&gt;<br />
            &lt;Name&gt;MyModule&lt;/Name&gt;<br />
            &lt;Description&gt;This is MyModule&lt;/Description&gt;<br />
            &lt;Class&gt;examples.weborb.ios.MyWowzaModule&lt;/Class&gt;<br />
          &lt;/Module&gt;<br />
        &lt;/Modules&gt;<br />
      &lt;/Application&gt;<br />
    &lt;/Root&gt;<br />
    
  8. Download the following file, rename it to IPhoneToWowza.jar and copy the jar file to [wowza-install-dir]/lib:
    http://examples.themidnightcoders.com/blog/IPhoneToWowza.rename-to-jar.zip
  9. Start Wowza Media Server
  10. Download Communication Library for iOS
  11. The distribution of the library includes all the examples demonstrated in the video. Open the examples project file in xcode and run the examples.

All the server-side Java source code for the demonstrated examples can be downloaded from: http://examples.themidnightcoders.com/blog/IPhoneToWowza.zip

WebORB and Grails Integration

We first announced Grails integration back when we released WebORB for Java 4.1. Today we have uploaded a new set of WebORB for Java Docs, which include the documentation describing the integration between WebORB for Java and Grails. The docs also include a detailed tutorial providing step-by-step instructions for creating a Grails application, deploying WebORB and developing a sample service. The tutorial is available at: http://www.themidnightcoders.com/fileadmin/docs/java/v4/grails_example_application.htm

Finally, the Grails integration has been reviewed in a webinar we conducted back in March. The video where the Grails integration is reviewed is linked below, make sure to fast forward to 5m:30sec into the video:

Integrating Flex Applications with NHibernate

Are you using NHibernate as your object-relational mapper? If so, did you know that WebORB provides an easy integration between Flex clients and NHibernate models? Enterprise Architect Joseph Magley demonstrates how to use WebORB with NHibernate and Flex in a recent technical article he wrote for the Adobe Developer Connection. Here is an excerpt from this article:

“In this tutorial I demonstrate a particularly easy-to-use combination of technologies that do a very good job at allowing you to focus on developing your features rather than maintaining plumbing. Modern development tools coupled with WebORB for .NET and NHibernate make it easier to maintain integration points. Development frameworks for data access such a NHibernate eliminate much of the glue code that developers often need to write and maintain. This decreases complexity and creates a solid environment for rapid development of RIAs.”

The complete article with sample code can be viewed here: http://www.adobe.com/devnet/flex/articles/flex-nhibernate.html