示例#1
0
        public ActionResult MusicPlayer(string albumId)
        {
            AlbumPlayerViewModel model = new AlbumPlayerViewModel();

            model.MediaId = albumId;
            WebTranscoderProfile profile = GetProfile(Connections.Current.MASStreamControl, Settings.ActiveSettings.DefaultAudioProfile);

            model.Tracks = Connections.Current.MAS.GetMusicTracksDetailedForAlbum(Settings.ActiveSettings.MusicProvider, albumId);
            return(CreatePlayer(Connections.Current.MASStreamControl, model, StreamTarget.GetAudioTargets(), profile, true));
        }
示例#2
0
        public ActionResult MusicPlayer(string albumId)
        {
            AlbumPlayerViewModel model = new AlbumPlayerViewModel();

            model.MediaId        = albumId;
            model.ContinuationId = "playlist-" + randomGenerator.Next(100000, 999999).ToString();
            WebTranscoderProfile profile = GetProfile(Connections.Current.MASStreamControl,
                                                      Configuration.StreamingPlatforms.GetDefaultProfileForUserAgent(StreamingProfileType.Audio, Request.UserAgent));

            model.Tracks = Connections.Current.MAS.GetMusicTracksDetailedForAlbum(Settings.ActiveSettings.MusicProvider, albumId);
            return(CreatePlayer(Connections.Current.MASStreamControl, model, StreamTarget.GetAudioTargets(), profile, true));
        }
示例#3
0
        public ActionResult Album(string album)
        {
            var albumObj = Connections.Current.MAS.GetMusicAlbumBasicById(Settings.ActiveSettings.MusicProvider, album);

            if (albumObj == null)
            {
                return(new HttpNotFoundResult());
            }
            var trackList = Connections.Current.MAS.GetMusicTracksDetailedForAlbum(Settings.ActiveSettings.MusicProvider, album, null, WebSortField.Title, WebSortOrder.Asc);
            var model     = new AlbumViewModel()
            {
                Album  = albumObj,
                Tracks = trackList.Where(x => !String.IsNullOrEmpty(x.Title))
            };

            return(View(AlbumPlayerViewModel.EnableAlbumPlayerForUserAgent(Request.UserAgent) ? "AlbumPlayer" : "Album", model));
        }