summaryrefslogtreecommitdiff
path: root/plex.cpp
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-02-21 15:33:48 +0100
committerchriszero <zerov83@gmail.com>2015-02-21 15:33:48 +0100
commit37043899a114c20b50d26ceb2992c2e670b6024e (patch)
tree7b2fa140f0c1516ec6b98db484144b997a09e946 /plex.cpp
parent8f5d88e50d24cde272662520901defef42d575c6 (diff)
downloadvdr-plugin-plex-37043899a114c20b50d26ceb2992c2e670b6024e.tar.gz
vdr-plugin-plex-37043899a114c20b50d26ceb2992c2e670b6024e.tar.bz2
Add feature "playmarks"
Diffstat (limited to 'plex.cpp')
-rw-r--r--plex.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/plex.cpp b/plex.cpp
index 0e40847..f9a1a84 100644
--- a/plex.cpp
+++ b/plex.cpp
@@ -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!