refactor video player, still has minor bugs