【问题标题】:How to get currently playing item in XBMC?如何在 XBMC 中获取当前正在播放的项目?
【发布时间】:2014-03-28 11:10:27
【问题描述】:

我想使用 json/rpc 来获取 XBMC 中当前正在播放的项目,我对所有播放器类型使用以下命令:

  • 获取活跃玩家:

    { "jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1 }

  • 由于上述结果而获得当前正在播放的项目:

    { "jsonrpc": "2.0", "method": "Playlist.GetItems", "params": { "playlistid": playlist.id, "properties": ["title", "rating", "season", "episode", "plot", "runtime", "showtitle", "thumbnail", "year", "genre"] }, "id": 1 }

现在,我有三种不同的情况:

1- 如果当前播放的项目是“movie”: 每件事都非常高效。

2- 如果当前播放的项目是“歌曲”: 结果集不仅包含当前播放的歌曲,还包含专辑中包含当前播放歌曲的所有歌曲。

3- 如果当前播放的项目是“tvShow 剧集”: 结果集是空的,就像当前没有播放一样。

【问题讨论】:

    标签: json json-rpc xbmc


    【解决方案1】:

    应该这样做:

    {
        "jsonrpc": "2.0",
        "method": "Player.GetItem",
        "params": {
            "properties": [
                "title",
                "album",
                "artist",
                "season",
                "episode",
                "duration",
                "showtitle",
                "tvshowid",
                "thumbnail",
                "file",
                "fanart",
                "streamdetails"
            ],
            "playerid": 1
        },
        "id": "VideoGetItem"
    }
    

    查看further API examples

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-12-14
      • 2012-04-22
      • 2014-11-27
      • 1970-01-01
      • 1970-01-01
      • 2015-05-17
      • 1970-01-01
      相关资源
      最近更新 更多