'Looks at the currently active configuration model to determine whether
the HLS Playback feature is available.
If the feature flag is not enabled, the feature is not available.
If the flag is enabled for all the courses, feature is available.
If the flag is enabled and the provided course_id is for an course
with HLS Playback enabled, the feature is available.
Arguments:
course_id (CourseKey): course id for whom feature will be checked.'

@classmethod
def feature_enabled(cls, course_id):

    if (not HLSPlaybackEnabledFlag.is_enabled()):
        return False
    elif (not HLSPlaybackEnabledFlag.current().enabled_for_all_courses):
        feature = CourseHLSPlaybackEnabledFlag.objects.filter(course_id=course_id).order_by('-change_date').first()
        return (feature.enabled if feature else False)
    return True
