Add logic for route media