Exemplo n.º 1
0
 /// <summary>
 /// Lookup an item and get details about it.
 /// </summary>
 /// <param name="client">An IXboxMusicClient instance.</param>
 /// <param name="itemId">Id to look up, prefixed by a namespace: {namespace.id}.</param>
 /// <param name="source">The content source: Catalog, Collection or both</param>
 /// <param name="language">ISO 2 letter code.</param>
 /// <param name="country">ISO 2 letter code.</param>
 /// <param name="extras">Enumeration of extra details.</param>
 /// <returns> Content response with details about one or more items.</returns>
 public static Task <ContentResponse> LookupAsync(this IXboxMusicClient client, string itemId, ContentSource?source = null, string language = null,
                                                  string country = null, ExtraDetails extras = ExtraDetails.None)
 {
     return(client.LookupAsync(new List <string> {
         itemId
     }, source, language, country, extras));
 }
Exemplo n.º 2
0
        public AlbumDetail()
        {
            clientId     = "SimpleDJ_802";
            clientSecret = "/Cthq+SIvtTJk1P9x04JX7P3H2RVzxZXqht0Yq5LqMg=";
            client       = XboxMusicClientFactory.CreateXboxMusicClient(clientId, clientSecret);

            HardwareButtons.BackPressed += HardwareButtons_BackPressed;
            this.InitializeComponent();
        }
Exemplo n.º 3
0
        private async Task AttemptLoginAsync()
        {
            if (_client != null)
            {
                return;
            }
            _client = XboxMusicClientFactory.CreateXboxMusicClient(apiKey.APIKey, apiKey.APISecret);
            await MakeCallAsync(SearchTerm, Namespace.music, 20);

            IsLoginVisible = Visibility.Collapsed;
        }
Exemplo n.º 4
0
        public MainPage()
        {
            clientId = "XboxMusicDJ_802";
            clientSecret = "KeVaxFVSlXqt9hMWTUPLI90aD3OKLNI/qns6kHJ6Cy4=";
            client = XboxMusicClientFactory.CreateXboxMusicClient(clientId, clientSecret);

            geolocator = new Geolocator();

            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;
        }
Exemplo n.º 5
0
        public MainPage()
        {
            clientId     = "XboxMusicDJ_802";
            clientSecret = "KeVaxFVSlXqt9hMWTUPLI90aD3OKLNI/qns6kHJ6Cy4=";
            client       = XboxMusicClientFactory.CreateXboxMusicClient(clientId, clientSecret);

            geolocator = new Geolocator();

            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;
        }
        public async Task TestGettingStarted()
        {
            // Start by registering an Azure Data Market client ID and secret ( see http://music.xbox.com/developer )

            // Create a client
            //IXboxMusicClient client = XboxMusicClientFactory.CreateXboxMusicClient("MyClientId", "YourClientSecretYourClientSecretYourSecret=");
            string           clientid     = ConfigurationManager.AppSettings["clientid"];
            string           clientsecret = ConfigurationManager.AppSettings["clientsecret"];
            IXboxMusicClient client       = XboxMusicClientFactory.CreateXboxMusicClient(clientid, clientsecret);

            // Use null to get your current geography.
            // Specify a 2 letter country code (such as "US" or "DE") to force a specific country.
            string country = null;

            // Search for albums in your current geography
            ContentResponse searchResponse = await client.SearchAsync(Namespace.music, "Foo Fighters", filter : SearchFilter.Albums, maxItems : 5, country : country);

            Console.WriteLine("Found {0} albums", searchResponse.Albums.TotalItemCount);
            foreach (Album albumResult in searchResponse.Albums.Items)
            {
                Console.WriteLine("{0}", albumResult.Name);
            }

            // List tracks in the first album
            Album           album          = searchResponse.Albums.Items[0];
            ContentResponse lookupResponse = await client.LookupAsync(album.Id, extras : ExtraDetails.Tracks, country : country);

            // Display information about the album
            album = lookupResponse.Albums.Items[0];
            Console.WriteLine("Album: {0} (link: {1}, image: {2})", album.Name, album.GetLink(ContentExtensions.LinkAction.Play), album.GetImageUrl(800, 800));
            foreach (Contributor contributor in album.Artists)
            {
                Artist artist = contributor.Artist;
                Console.WriteLine("Artist: {0} (link: {1}, image: {2})", artist.Name, artist.GetLink(), artist.GetImageUrl(1920, 1080));
            }
            foreach (Track track in album.Tracks.Items)
            {
                Console.WriteLine("Track: {0} - {1}", track.TrackNumber, track.Name);
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// Get a 30s preview of a media
 /// </summary>
 /// <param name="client">An IXboxMusicClient instance to extend</param>
 /// <param name="id">Id of the media to be streamed</param>
 /// <param name="country">ISO 2 letter code.</param>
 /// <returns>Stream response containing the url, expiration date and content type</returns>
 static public Task <StreamResponse> PreviewAsync(this IXboxMusicClient client, string id, string country = null)
 {
     return(client.PreviewAsync(id, ClientInstanceId, country));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Stream a media
 /// Access to this API is restricted under the terms of the Xbox Music API Pilot program (http://music.xbox.com/developer/pilot).
 /// </summary>
 /// <param name="client">An IXboxMusicClient instance to extend</param>
 /// <param name="id">Id of the media to be streamed</param>
 /// <returns>Stream response containing the url, expiration date and content type</returns>
 static public Task <StreamResponse> StreamAsync(this IXboxMusicClient client, string id)
 {
     return(client.StreamAsync(id, ClientInstanceId));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Request the continuation of an incomplete list of content from the service. The relative URL (i.e. the ids list) must be the same as in the original request.
 /// </summary>
 /// <param name="client">An IXboxMusicClient instance.</param>
 /// <param name="itemId">Id to look up, prefixed by a namespace: {namespace.id}.</param>
 /// <param name="continuationToken">A Continuation Token provided in an earlier service response.</param>
 /// <returns> Content response with details about one or more items.</returns>
 public static Task <ContentResponse> LookupContinuationAsync(this IXboxMusicClient client, string itemId, string continuationToken)
 {
     return(client.LookupContinuationAsync(new List <string> {
         itemId
     }, continuationToken));
 }
Exemplo n.º 10
0
 public GrooveMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
     _client = XboxMusicClientFactory.CreateXboxMusicClient(ApiKeys.XboxClientId, ApiKeys.XboxClientSecret);
 }
Exemplo n.º 11
0
 private async Task AttemptLoginAsync() {
     if (_client != null) return;
     _client = XboxMusicClientFactory.CreateXboxMusicClient(apiKey.APIKey, apiKey.APISecret);
     await MakeCallAsync(SearchTerm, Namespace.music, 20);
     IsLoginVisible = Visibility.Collapsed;
 }
Exemplo n.º 12
0
 public GrooveMetadataProvider(ISettingsUtility settingsUtility) : base(settingsUtility)
 {
     _client = XboxMusicClientFactory.CreateXboxMusicClient(ApiKeys.XboxClientId, ApiKeys.XboxClientSecret);
 }