Refactored time capturing directive for video playing