Fix runtime errors in simulator while playing media