public function qualityFactorComparator($mediaType1, $mediaType2)
    {
        $diff = $mediaType2['q'] - $mediaType1['q'];

        // doesn't cope too well with values 1 > v > -1, so make sure we return simple integers
        if ($diff > 0) {
            $diff = 1;
        } elseif ($diff < 0) {
            $diff = -1;
        }

        return $diff;
    }