Wireless Live Streaming Example
The source code is available on GitHub.
https://github.com/ricohapi/theta-wireless-live-streaming-plugin
You may need to clone the repo with Git Large File Storage if you want to download the pre-compiled apk with the repo. This guide covers working with the source code and compiling it within Android Studio.
Usage of the Wireless Live Streaming plug-in is covered extensively in the Plug-in User Guide (free registration to community required).
Import Project
You do not need to build from source if you want to test the plug-in functionality. You can go to the THETA Store and download the plug-in for free.
After extracting the files, you will see a standard project structure. If you extracted from a zipped file, the pre-compiled apk will not work. You must build from source.
In Android Studio, go to File -> New -> Import Project....
Select the wireless-live-streaming project. I needed to change the name of the project to a shorter project name.
After importing into Android Studio, you will see your project files.
Browse Files
Look into the web server and rtmp libraries that the plug-in is using.
NanoHTTPD for web server configuration
One of the more interesting files is the AndroidWebServer that is used for the configuration of the plug-in through a web browser.
The import statement shows the use of the NanoHTTPD package that is available on GitHub.
By using this technique, you can build a browser-based tool that allows your users to connect to the camera with a mobile phone or desktop computer. See the plug-in user guide for more information on this technique.
rtmp libraries
- rtmp-rtsp-stream-client-java by pedroSG94
- SimpleRtmp by faucamp
After looking at the file structure, build the package.
Build
Ignore the warning about deprecated API.
Focus on the happier APK(s) generated successfully message.
Install
Use adb to install the apk. The command is adb install app-debug.apk
.
You can specify by full path of the file on the cmd prompt by dragging the
file from File Explorer onto the Command Prompt.
Look for the Success status message.
Permissions
I suggest you use Vysor to check the permissions of the plug-in.
Go to settings.
Go to Apps. Select Wireless Live Streaming.
Select Permissions.
Set Camera and Microphone permissions.
Note that audio streaming is single channel.