aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2014-09-25 21:53:16 +0200
committerMemphiz <memphis@machzwo.de>2014-10-06 14:14:51 +0200
commit7f067bdb24602a5c550cf3adffe505d54cfc336c (patch)
tree1bc04dc66006685207cde507a1313396163c13ee
parent392babec96915939f416efa6888e1379140ad725 (diff)
[airplay] - support the /play command which wants us to start playback "paused" - (camera roll on ios8 for example)
-rw-r--r--xbmc/network/AirPlayServer.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/xbmc/network/AirPlayServer.cpp b/xbmc/network/AirPlayServer.cpp
index 5340d720be..f9e04a0d0a 100644
--- a/xbmc/network/AirPlayServer.cpp
+++ b/xbmc/network/AirPlayServer.cpp
@@ -868,6 +868,7 @@ int CAirPlayServer::CTCPClient::ProcessRequest( std::string& responseHeader,
{
std::string location;
float position = 0.0;
+ bool startPlayback = true;
m_lastEvent = EVENT_NONE;
CLog::Log(LOGDEBUG, "AIRPLAY: got request %s", uri.c_str());
@@ -910,6 +911,18 @@ int CAirPlayServer::CTCPClient::ProcessRequest( std::string& responseHeader,
tmpNode = NULL;
}
+ tmpNode = m_pLibPlist->plist_dict_get_item(dict, "rate");
+ if (tmpNode)
+ {
+ double rate = 0;
+ m_pLibPlist->plist_get_real_val(tmpNode, &rate);
+ if (rate == 0.0)
+ {
+ startPlayback = false;
+ }
+ tmpNode = NULL;
+ }
+
// in newer protocol versions the location is given
// via host and path where host is ip:port and path is /path/file.mov
if (location.empty())
@@ -951,6 +964,13 @@ int CAirPlayServer::CTCPClient::ProcessRequest( std::string& responseHeader,
// one who will work well with airplay
g_application.m_eForcedNextPlayer = EPC_DVDPLAYER;
CApplicationMessenger::Get().MediaPlay(fileToPlay);
+
+ // allow starting the player paused in ios8 mode (needed by camera roll app)
+ if (CSettings::Get().GetBool("services.airplayios8compat") && !startPlayback)
+ {
+ CApplicationMessenger::Get().MediaPause();
+ g_application.m_pPlayer->SeekPercentage(position * 100.0f);
+ }
}
}