Skip to content

Commit

Permalink
番組情報取得時にIDを直接指定できる
Browse files Browse the repository at this point in the history
  • Loading branch information
TORISOUP committed May 30, 2019
1 parent d8026e1 commit f96719c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions Assets/NicoliveClient/Plugins/Client/NicoliveApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,24 @@ private IEnumerator ExtendProgramCoroutine(IObserver<ExtendResult> observer, int
/// <summary>
/// 番組情報を取得する
/// </summary>
public IObservable<ProgramInfo> GetProgramInfoAsync(string programId)
{
return Observable.FromCoroutine<ProgramInfo>(o => GetProgramInfo(o, programId)).Kick();
}

/// <summary>
/// 番組情報を取得する
/// SetNicoliveProgramId()で設定された番組IDを対象とする
/// </summary>
public IObservable<ProgramInfo> GetProgramInfoAsync()
{
return Observable.FromCoroutine<ProgramInfo>(GetProgramInfo).Kick();
return Observable.FromCoroutine<ProgramInfo>(o => GetProgramInfo(o, null)).Kick();
}

private IEnumerator GetProgramInfo(IObserver<ProgramInfo> observer)
private IEnumerator GetProgramInfo(IObserver<ProgramInfo> observer, string programId)
{
var url = string.Format("https://live2.nicovideo.jp/watch/{0}/programinfo", NicoliveProgramId);
var lv = string.IsNullOrEmpty(programId) ? NicoliveProgramId : programId;
var url = string.Format("https://live2.nicovideo.jp/watch/{0}/programinfo", lv);

using (var www = UnityWebRequest.Get(url))
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/NicoliveClient/Plugins/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019.4.9
2019.5.30

0 comments on commit f96719c

Please sign in to comment.