sunnyhd / homeintouch

A home automation project using socket.io
2 stars 0 forks source link

Playlists/Players - Switching media #29

Open sunnyhd opened 12 years ago

sunnyhd commented 12 years ago

The Playlists and Players state doesnt get updated when switching media from music to movies for example. At the moment you have to refresh the page.

We should react on the Player.OnPlay messages that XBMC sends when something starts to play to get the type of media and ask for the Player.GetItem and directly display whats playing.

scttnlsn commented 12 years ago

@sunnyhd Does XBMC allow multiple players to be active simultaneously? I'm wondering if a call to Player.GetActivePlayers will ever return more than a single player.

sunnyhd commented 12 years ago

You only get 2 players active when you play music and a slideshow/picture.

{"id":1,"jsonrpc":"2.0","result":[{"playerid":0,"type":"audio"},{"playerid":2,"type":"picture"}]}

scttnlsn commented 12 years ago

The Player.OnStop notification isn't passing a playerid. Is the playerid omitted when there is only a single active player?

sunnyhd commented 12 years ago

The Player.OnStop notification never displays the playerid just the type song or movie. For Pictures there are no notifications at all.

scttnlsn commented 12 years ago

Say there's a movie currently playing and then one starts playing a song...no Player.OnStop notification is sent even though the movie stops. I will need to rely on the assumption that only a single player can exist (except for audio/pictures) to handle these cases.

sunnyhd commented 12 years ago

There can only exist the video player or the audio/picture player. When you get the the Player.OnPlay notification the media should be updatet on the player/playlist page.

scttnlsn commented 12 years ago

@sunnyhd I believe I have the players updating properly now. How were you imagining the playlists being updated?

sunnyhd commented 12 years ago

The player is updating with a delay of some seconds. Do you trigger the Player.OnPlay notification? The Playlists doesnt update automatically. There you have to activate the playlist to get updated. Could we jump here to the active player automatically when its music or video and update the list.