implementing play mode and applying encoding