We could do that if we'll include KalturaCommon.php at the top of mwEmbedLoader.php
Then we will have access to the container and the request object.
Anyway I cleaned it up a little bit.