Extracted player logic

Bug fix to endpage detection