예제 #1
0
        public static bool EnableAlbumPlayerForUserAgent(string userAgent)
        {
            var defaultProfile = Configuration.StreamingPlatforms.GetDefaultProfileForUserAgent(StreamingProfileType.Audio, userAgent);
            var profile        = Connections.Current.MASStreamControl.GetTranscoderProfileByName(defaultProfile);

            return(Configuration.WebMediaPortal.EnableAlbumPlayer &&
                   StreamTarget.GetAudioTargets().Any(audioTarget => profile.Targets.Contains(audioTarget.Name)));
        }
예제 #2
0
        private IEnumerable <SelectListItem> GetProfileSelectList(StreamingProfileType type)
        {
            var service          = type == StreamingProfileType.Tv ? Connections.Current.TASStreamControl : Connections.Current.MASStreamControl;
            var defaultProfile   = Configuration.StreamingPlatforms.GetDefaultProfileForPlatform(type, Name);
            var targets          = type == StreamingProfileType.Audio ? StreamTarget.GetAllTargets() : StreamTarget.GetVideoTargets();
            var supportedTargets = Configuration.StreamingPlatforms.GetValidTargetsForPlatform(Name).Intersect(targets.Select(x => x.Name));

            return(ProfileModel.GetProfilesForTargets(service, supportedTargets)
                   .Select(x => new SelectListItem()
            {
                Text = x.Name, Value = x.Name, Selected = x.Name == defaultProfile
            })
                   .OrderBy(x => x.Text));
        }