Hi all,
I just pushed a commit in master that aims at making it easier to handle unsupported codecs in the VideoRoom from a client perspective:
The main use case for me was of course Safari joining a VP8 only VideoRoom, and make sure things would not just fail but simply fall back to an alternative, but this is generic enough that it can be applied to other contexts as well you may be facing.
The way it works is pretty easy. Whenever you publish in a VideoRoom, you get info back (along with the SDP) about the audio and/or video codecs that you'll be using in the room. If any medium was rejected, the codec will be missing: this means that, if you know you asked to publish video, but you don't see any video codec in the response (e.g., you're only negotiating H.264, but the room is VP8 only), then you know your video was rejected, without having to dig in the SDP yourself to look at the video m-line (which you can do, but is much more annoying). In the VideoRoom demo, I handle this by showing a floating warning, and replacing the local video feed with an icon as when you don't publish video at all, so that you know nobody is going to see you. The format for the new event looks something like this:
"room" : 1234,
"audio_codec" : "opus", <--- new attribute, only present if your audio has been accepted
"video_codec" : "vp8" <--- new attribute, only present if your video has been accepted
For viewers, the approach is similar. Now, whenever the plugin sends you a list of the active publishers, you don't only get "id" and "display" as before, but also the codecs that the publisher is using to publish. Again, this helps the viewer decide whether to subscribe to everything, or only a subset of the stream. In the current VideoRoom demo, for instance, we check if the browser is Safari, and if a publisher's video codec is VP8, then we show a warning and only subscribe to the publisher's audio. This makes it suboptimal for the browser with unsupported codecs, but still allows them to participate, instead of just showing an error when trying to process an SDP they can't digest. The attributes you'll find in the publishers list are exactly the same as the ones I've shown above.
Hope this helps,
Lorenzo