Skip to content

Commit

Permalink
Add usage to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Yang committed May 19, 2015
1 parent f01c01e commit 43cccdd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,19 @@
A .NET client library for douban.fm

**NOTE: This project is still under development.**

## Usage
1. Install [the nuget package](https://www.nuget.org/packages/Kfstorm.DoubanFM.Core/) to your project.
2. Create an instance of `IPlayer` interface and call the methods. Here is the sample code:

```
var player = new Player(new Session(new ServerConnection("02646d3fb69a52ff072d47bf23cef8fd", "cde5d61429abcd7c", "radio_iphone", "100", new Uri("http://www.douban.com/mobile/fm"), Guid.NewGuid().ToString("N"))));
await player.RefreshChannelList();
var newChannel = player.ChannelList.ChannelGroups[0].Channels[0];
var channelName = newChannel.Name;
await player.ChangeChannel(newChannel);
var currentSong = player.CurrentSong;
var title = currentSong.Title;
var url = currentSong.Url;
await player.Next(NextCommandType.SkipCurrentSong);
```

0 comments on commit 43cccdd

Please sign in to comment.