I have a system where I am dynamically creating streams using Stream.createInstance.

It all works fine with RTMP, but with Cupertino streams the delay in creating enough buffer means that the first HTTP client to connect to a stream is rejected.

I've been playing around with different possible solutions. The closest I've got is to use the StreamNameAliasProvider or MediaListProvider to intercept a stream, and check if it is already running. If it's not, I can play a "silence.mp3" or whatever to the user for a few seconds while I kick off the real stream.

However, I can't figure out a consistent way to switch the httpSession to the real stream.

MediaListRendition API seems to work occasionally but not consistently.

Please can somebody give me an example of how this kind of thing could be achieved.