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):
- Download and install Wowza Media Server
- Create “ios” folder under [wowza-install-dir]/applications
- Create “ios” folder under [wowza-install-dir]/conf
- Create Application.xml file in [wowza-install-dir]/conf/ios with the following contents:
<br /> <Root><br /> <Application><br /> <Connections><br /> <AutoAccept>true</AutoAccept><br /> <AllowDomains></AllowDomains><br /> </Connections><br /> <SharedObjects><br /> <StorageDir></StorageDir><br /> </SharedObjects><br /> <Client><br /> <IdleFrequency>-1</IdleFrequency><br /> <Access><br /> <StreamReadAccess>*</StreamReadAccess><br /> <StreamWriteAccess>*</StreamWriteAccess><br /> <StreamAudioSampleAccess></StreamAudioSampleAccess><br /> <StreamVideoSampleAccess></StreamVideoSampleAccess><br /> <SharedObjectReadAccess>*</SharedObjectReadAccess><br /> <SharedObjectWriteAccess>*</SharedObjectWriteAccess><br /> </Access><br /> </Client><br /> <Modules><br /> <Module><br /> <Name>MyModule</Name><br /> <Description>This is MyModule</Description><br /> <Class>examples.weborb.ios.MyWowzaModule</Class><br /> </Module><br /> </Modules><br /> </Application><br /> </Root><br /> - Create “CallbackDemo” folder under [wowza-install-dir]/applications
- Create “CallbackDemo” folder under [wowza-install-dir]/conf
- Create the Application.xml file in [wowza-install-dir]/conf/CallbackDemo with the following contents:
<br /> <Root><br /> <Application><br /> <Connections><br /> <AutoAccept>true</AutoAccept><br /> <AllowDomains></AllowDomains><br /> </Connections><br /> <SharedObjects><br /> <StorageDir></StorageDir><br /> </SharedObjects><br /> <Client><br /> <IdleFrequency>-1</IdleFrequency><br /> <Access><br /> <StreamReadAccess>*</StreamReadAccess><br /> <StreamWriteAccess>*</StreamWriteAccess><br /> <StreamAudioSampleAccess></StreamAudioSampleAccess><br /> <StreamVideoSampleAccess></StreamVideoSampleAccess><br /> <SharedObjectReadAccess>*</SharedObjectReadAccess><br /> <SharedObjectWriteAccess>*</SharedObjectWriteAccess><br /> </Access><br /> </Client><br /> <Modules><br /> <Module><br /> <Name>MyModule</Name><br /> <Description>This is MyModule</Description><br /> <Class>examples.weborb.ios.MyWowzaModule</Class><br /> </Module><br /> </Modules><br /> </Application><br /> </Root><br /> - 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 - Start Wowza Media Server
- Download Communication Library for iOS
- 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
