diff options
-rw-r--r-- | PVideo.cpp | 1 | ||||
-rw-r--r-- | plex.cpp | 36 | ||||
-rw-r--r-- | plex.h | 2 |
3 files changed, 25 insertions, 14 deletions
@@ -7,6 +7,7 @@ namespace plexclient Video::Video(Poco::XML::Node* pNode, PlexServer Server, MediaContainer* parent) { m_iMyPlayOffset = 0; + m_lViewoffset = 0; m_Server = Server; NodeIterator it(pNode, Poco::XML::NodeFilter::SHOW_ALL); Poco::XML::Node* pChildNode = it.nextNode(); @@ -2,19 +2,6 @@ #include "SubscriptionManager.h" #include "plex.h" -/** -** Play a file. -** -** @param filename path and file name -*/ -static void PlayFile(plexclient::Video Vid) -{ - isyslog("[plex]: play file '%s'\n", Vid.m_sKey.c_str()); - cControl* control = cHlsPlayerControl::Create(Vid); - if(control) { - cControl::Launch(control); - } -} ////////////////////////////////////////////////////////////////////////////// // cOsdMenu @@ -111,7 +98,7 @@ eOSState cPlexBrowser::ProcessSelected() if(item->IsVideo()) { - PlayFile(*item->GetAttachedVideo()); + cMyPlugin::PlayFile(*item->GetAttachedVideo()); return osEnd; } @@ -365,4 +352,25 @@ bool cMyPlugin::SetupParse(const char *name, const char *value) return true; } +/** +** Play a file. +** +** @param filename path and file name +*/ +void cMyPlugin::PlayFile(plexclient::Video Vid) +{ + isyslog("[plex]: play file '%s'\n", Vid.m_sKey.c_str()); + if(Vid.m_lViewoffset > 0 ) { + cString message = cString::sprintf(tr("To start from %ld minutes, press Ok."), Vid.m_lViewoffset / 60000); + eKeys response = Skins.Message(eMessageType::mtInfo, message, 5); + if(response == kOk) { + Vid.m_iMyPlayOffset = Vid.m_lViewoffset/1000; + } + } + cControl* control = cHlsPlayerControl::Create(Vid); + if(control) { + cControl::Launch(control); + } +} + VDRPLUGINCREATOR(cMyPlugin); // Don't touch this! @@ -96,6 +96,8 @@ public: virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *, const char *); + + static void PlayFile(plexclient::Video Vid); }; |