add player toggle to javascript