Refactored Player media change detection code.
Updated to use latest API