To start publishing/recording:
MediaCasterStreamMap mediaCasterMap = appInstance.getMediaCasterStreams(); MediaCasterStreamItem mediaCasterItem = mediaCasterMap.acquire(streamName);
To stop publishing/recording (unless there are connected clients, then it will continue):
The acquire call will start the publishing/recording process if it's not already started and will keep it going even if all clients stop viewing the stream. The release call will remove the stream lock. If no clients are currently viewing the stream, then it will be unloaded. If clients are viewing the stream, it will follow the normal rules. You must have matching calls to acquire and release for the system to work properly (equal number of calls to acquire and release).
If you're having problems or want to discuss this article, post in our forum.