added theoretical support for media. Not tested yet.