summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-09-27 15:52:23 +0200
committerchriszero <zerov83@gmail.com>2015-09-27 15:52:23 +0200
commit004e8940e25c3bca2b9219a5494e80b3c9b3ab9c (patch)
treeeb1e5b180bbbb6fcc265cc816b660dc64f6f7e52
parentf22f21bcacdd4b57b14e5400fe6a55cf83b268d3 (diff)
downloadvdr-plugin-plex-development.tar.gz
vdr-plugin-plex-development.tar.bz2
Own replay control for skinningdevelopment
-rw-r--r--Makefile3
-rw-r--r--Plexservice.cpp17
-rw-r--r--hlsPlayer.cpp13
-rw-r--r--hlsPlayer.h1
-rw-r--r--hlsPlayerControl.h1
-rw-r--r--plex.cpp5
-rw-r--r--plexSdOsd.h1
-rw-r--r--sdDisplayReplay.cpp131
-rw-r--r--sdDisplayReplay.h48
-rw-r--r--skins/blackhole/themes/default/skinparts/plexplaceholder.svg130
-rw-r--r--skins/blackhole/xmlfiles/plug-plex-detail.xml16
-rw-r--r--skins/blackhole/xmlfiles/plug-plex-root.xml405
12 files changed, 216 insertions, 555 deletions
diff --git a/Makefile b/Makefile
index b11e68e..d75fe52 100644
--- a/Makefile
+++ b/Makefile
@@ -95,7 +95,8 @@ OBJS = $(PLUGIN).o \
browserGrid.o \
viewHeader.o \
detailView.o \
- pictureCache.o
+ pictureCache.o \
+ sdDisplayReplay.o
SRCS = $(wildcard $(OBJS:.o=.c)) $(PLUGIN).cpp
diff --git a/Plexservice.cpp b/Plexservice.cpp
index 20db51e..0a7cd58 100644
--- a/Plexservice.cpp
+++ b/Plexservice.cpp
@@ -194,11 +194,13 @@ std::string Plexservice::GetUniversalTranscodeUrl(Video* video, int offset, Plex
{
PlexServer* pSrv = server ? server : video->m_pServer;
std::stringstream params;
- params << "/video/:/transcode/universal/start.m3u8?";
+ //params << "/video/:/transcode/universal/start.m3u8?";
+ params << "/video/:/transcode/universal/start?";
params << "path=" << encode(pSrv->GetUri() + video->m_sKey);
params << "&mediaIndex=0";
params << "&partIndex=0";
params << "&protocol=hls";
+ //params << "&protocol=dash";
params << "&offset=" << offset;
params << "&fastSeek=1";
params << "&directPlay=0";
@@ -211,8 +213,17 @@ std::string Plexservice::GetUniversalTranscodeUrl(Video* video, int offset, Plex
params << "&videoResolution=1920x1080";
params << "&videoQuality=100";
params << "&session=" << encode(Config::GetInstance().GetUUID()); // TODO: generate Random SessionID
-
-
+
+ params << "&X-Plex-Client-Identifier=" << encode(Config::GetInstance().GetUUID());
+ params << "&X-Plex-Device=PC";
+ params << "&X-Plex-Device-Name=" << encode(Config::GetInstance().GetHostname());
+ params << "&X-Plex-Language=" << Config::GetInstance().GetLanguage();
+ params << "&X-Plex-Model=Linux";
+ params << "&X-Plex-Platform=" << encode("VDR Plex Plugin");;
+ params << "&X-Plex-Product=" << encode("VDR Plex Plugin");
+ params << "&X-Plex-Provides=player";
+
+ //std::cout << pSrv->GetUri() << params.str() << std::endl;
return pSrv->GetUri() + params.str();
}
diff --git a/hlsPlayer.cpp b/hlsPlayer.cpp
index 4a19a2a..8e0892c 100644
--- a/hlsPlayer.cpp
+++ b/hlsPlayer.cpp
@@ -7,6 +7,7 @@
#include <pcrecpp.h>
#include <algorithm>
+#include <fstream>
#include "Plexservice.h"
#include "XmlObject.h"
@@ -438,12 +439,20 @@ cHlsPlayer::cHlsPlayer(std::string startm3u8, plexclient::Video Video, int offse
m_isBuffering = false;
AudioIndexOffset = 1000; // Just a magic number
m_tTimer.Set(1);
+ m_pDebugFile = NULL;
+
+ m_pDebugFile = new std::ofstream();
+ m_pDebugFile->open("debug.ts", std::ios::out);
}
cHlsPlayer::~cHlsPlayer()
{
dsyslog("[plex]: '%s'", __FUNCTION__);
Cancel();
+ if(m_pDebugFile) m_pDebugFile->close();
+ delete m_pDebugFile;
+ m_pDebugFile = NULL;
+
delete m_pSegmentLoader;
m_pSegmentLoader = NULL;
Detach();
@@ -530,6 +539,10 @@ bool cHlsPlayer::DoPlay(void)
uchar* toPlay = m_pSegmentLoader->m_pRingbuffer->Get(bytesAvaliable);
if(bytesAvaliable >= TS_SIZE) {
int playedBytes = PlayTs(toPlay, TS_SIZE, false);
+ // save stream to disk to debug data
+ if(m_pDebugFile)
+ m_pDebugFile-> write((char*)toPlay, playedBytes);
+
m_pSegmentLoader->m_pRingbuffer->Del(playedBytes);
res = true;
} else {
diff --git a/hlsPlayer.h b/hlsPlayer.h
index f08505a..1e88deb 100644
--- a/hlsPlayer.h
+++ b/hlsPlayer.h
@@ -75,6 +75,7 @@ public:
class cHlsPlayer : public cPlayer, cThread
{
private:
+ std::ofstream* m_pDebugFile;
int AudioIndexOffset;
cHlsSegmentLoader* m_pSegmentLoader;
plexclient::Video m_Video;
diff --git a/hlsPlayerControl.h b/hlsPlayerControl.h
index fb2ba3f..90dc0e2 100644
--- a/hlsPlayerControl.h
+++ b/hlsPlayerControl.h
@@ -3,6 +3,7 @@
#include <vdr/player.h>
#include <vdr/tools.h>
+//#include <libskindesignerapi/skindesignerosdbase.h>
#include "hlsPlayer.h"
#include "MediaContainer.h"
diff --git a/plex.cpp b/plex.cpp
index cf09120..d4b3030 100644
--- a/plex.cpp
+++ b/plex.cpp
@@ -5,6 +5,7 @@
#include "plexSdOsd.h"
#include "pictureCache.h"
#include "services.h"
+#include "sdDisplayReplay.h"
#include <libskindesignerapi/skindesignerapi.h>
@@ -73,6 +74,10 @@ bool cMyPlugin::Start(void)
reg.SetViewElement(viRootView, verWatch, "time");
reg.SetViewElement(viRootView, verMessage, "message");
reg.SetViewElement(viRootView, verScrollbar, "scrollbar");
+
+ reg.SetView(viReplay, "replay.xml");
+ reg.SetViewElement(viReplay, cSdDisplayReplay::eElements::Info, "info");
+ reg.SetViewElement(viReplay, cSdDisplayReplay::eElements::Replay, "replay");
/*
reg.SetSubView(viRootView, viDetailView, "detail.xml");
reg.SetViewElement(viDetailView, vedBackground, "background");
diff --git a/plexSdOsd.h b/plexSdOsd.h
index bacf3dc..d620001 100644
--- a/plexSdOsd.h
+++ b/plexSdOsd.h
@@ -22,6 +22,7 @@
enum eViews {
viRootView,
+ viReplay,
viDetailView
};
diff --git a/sdDisplayReplay.cpp b/sdDisplayReplay.cpp
new file mode 100644
index 0000000..8e67904
--- /dev/null
+++ b/sdDisplayReplay.cpp
@@ -0,0 +1,131 @@
+#include "sdDisplayReplay.h"
+#include "plexSdOsd.h"
+
+cSdDisplayReplay::cSdDisplayReplay(plexclient::Video Video, cHlsPlayerControl* Control)
+{
+ m_video = Video;
+ m_pContol = Control;
+ m_pRootView = NULL;
+ m_lastsecond = 0;
+}
+
+cSdDisplayReplay::~cSdDisplayReplay()
+{
+ delete m_pRootView;
+}
+
+void cSdDisplayReplay::Show(void)
+{
+ bool skinDesignerAvailable = InitSkindesignerInterface("plex");
+ if (!skinDesignerAvailable) {
+ return;
+ }
+
+ m_pRootView = GetOsdView(eViews::viReplay);
+ if (!m_pRootView) {
+ esyslog("[plex]: used skindesigner skin does not support plex");
+ return;
+ }
+ m_pInfo = std::shared_ptr<skindesignerapi::cViewElement>(m_pRootView->GetViewElement(eElements::Info));
+ m_pReplay = std::shared_ptr<skindesignerapi::cViewElement>(m_pRootView->GetViewElement(eElements::Replay));
+ m_pTime = std::shared_ptr<skindesignerapi::cViewElement>(m_pRootView->GetViewElement(eElements::Time));
+ m_pBackground = std::shared_ptr<skindesignerapi::cViewElement>(m_pRootView->GetViewElement(eElements::Background));
+}
+
+//eOSState cSdDisplayReplay::ProcessKey(eKeys Key)
+//{
+//}
+
+void cSdDisplayReplay::DrawInfo()
+{
+ m_pInfo->Clear();
+ m_video.AddTokens(m_pInfo);
+}
+
+void cSdDisplayReplay::DrawReplay()
+{
+ m_pReplay->ClearTokens();
+ m_video.AddTokens(m_pReplay, false);
+
+ int current, total;
+ m_pContol->GetIndex(current, total);
+
+ m_pReplay->AddIntToken("progresstotal", total / m_pContol->FramesPerSecond());
+ m_pReplay->AddIntToken("progresscurrent", current / m_pContol->FramesPerSecond());
+
+ bool play, forward;
+ int speed;
+ m_pContol->GetReplayMode(play, forward, speed);
+
+ m_pReplay->AddIntToken("playing", speed >= 0);
+ m_pReplay->AddIntToken("pausing", !play);
+ //m_pReplay->AddIntToken("seeking", 0);
+ m_pReplay->AddStringToken("totaltime", IndexToHMS(total));
+ m_pReplay->AddStringToken("currenttime", IndexToHMS(current));
+ m_pReplay->AddStringToken("endtime", "hh:mm");
+}
+
+void cSdDisplayReplay::Flush()
+{
+ m_pInfo->Display();
+ m_pReplay->Display();
+ m_pRootView->Display();
+}
+
+bool cSdDisplayReplay::DrawTime()
+{
+ time_t t = time(0); // get time now
+ struct tm * now = localtime(&t);
+ int sec = now->tm_sec;
+ if (sec == m_lastsecond)
+ return false;
+
+ int min = now->tm_min;
+ int hour = now->tm_hour;
+ int hourMinutes = hour%12 * 5 + min / 12;
+
+ char monthname[20];
+ char monthshort[10];
+ strftime(monthshort, sizeof(monthshort), "%b", now);
+ strftime(monthname, sizeof(monthname), "%B", now);
+
+ m_pTime->Clear();
+ m_pTime->ClearTokens();
+ m_pTime->AddIntToken("sec", sec);
+ m_pTime->AddIntToken("min", min);
+ m_pTime->AddIntToken("hour", hour);
+ m_pTime->AddIntToken("hmins", hourMinutes);
+ m_pTime->AddIntToken("year", now->tm_year + 1900);
+ m_pTime->AddIntToken("day", now->tm_mday);
+ m_pTime->AddStringToken("time", *TimeString(t));
+ m_pTime->AddStringToken("monthname", monthname);
+ m_pTime->AddStringToken("monthnameshort", monthshort);
+ m_pTime->AddStringToken("month", *cString::sprintf("%02d", now->tm_mon + 1));
+ m_pTime->AddStringToken("dayleadingzero", *cString::sprintf("%02d", now->tm_mday));
+ m_pTime->AddStringToken("dayname", *WeekDayNameFull(now->tm_wday));
+ m_pTime->AddStringToken("daynameshort", *WeekDayName(now->tm_wday));
+ m_pTime->Display();
+
+ m_lastsecond = sec;
+ return true;
+}
+
+std::string cSdDisplayReplay::IndexToHMS(int Index, bool WithSeconds)
+{
+ std::stringstream ss;
+ if (Index < 0) {
+ Index = -Index;
+ ss << "-";
+ }
+
+ int s = Index / m_pContol->FramesPerSecond();
+ int m = s / 60 % 60;
+ int h = s / 3600;
+ s %= 60;
+ ss << h << ":" << m;
+
+ if(WithSeconds) {
+ ss << ":" << s;
+ }
+ return ss.str();
+}
diff --git a/sdDisplayReplay.h b/sdDisplayReplay.h
new file mode 100644
index 0000000..e580e16
--- /dev/null
+++ b/sdDisplayReplay.h
@@ -0,0 +1,48 @@
+#ifndef CSDDISPLAYREPLAY_H
+#define CSDDISPLAYREPLAY_H
+
+#include <vdr/osdbase.h>
+#include <libskindesignerapi/osdelements.h>
+#include <libskindesignerapi/skindesignerosdbase.h>
+#include <memory>
+
+#include "PVideo.h"
+#include "hlsPlayerControl.h"
+
+class cSdDisplayReplay : public skindesignerapi::cSkindesignerOsdObject
+{
+public:
+ enum eElements {
+ Background,
+ Replay,
+ Info,
+ Time
+ };
+
+ cSdDisplayReplay(plexclient::Video Video, cHlsPlayerControl* Control);
+ ~cSdDisplayReplay();
+
+ virtual void Show(void);
+ //virtual eOSState ProcessKey(eKeys Key);
+
+private:
+ plexclient::Video m_video;
+ cHlsPlayerControl* m_pContol;
+
+ skindesignerapi::cOsdView* m_pRootView;
+ std::shared_ptr<skindesignerapi::cViewElement> m_pBackground;
+ std::shared_ptr<skindesignerapi::cViewElement> m_pReplay;
+ std::shared_ptr<skindesignerapi::cViewElement> m_pInfo;
+ std::shared_ptr<skindesignerapi::cViewElement> m_pTime;
+
+ int m_lastsecond;
+
+ void DrawReplay();
+ void DrawInfo();
+ bool DrawTime();
+ void Flush();
+
+ std::string IndexToHMS(int index, bool WithSeconds = true);
+};
+
+#endif // CSDDISPLAYREPLAY_H
diff --git a/skins/blackhole/themes/default/skinparts/plexplaceholder.svg b/skins/blackhole/themes/default/skinparts/plexplaceholder.svg
deleted file mode 100644
index 747b38d..0000000
--- a/skins/blackhole/themes/default/skinparts/plexplaceholder.svg
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="280"
- height="420"
- id="svg2"
- version="1.1"
- inkscape:version="0.48.4 r9939"
- sodipodi:docname="Neues Dokument 1">
- <defs
- id="defs4">
- <radialGradient
- id="radialGradient-1"
- r="722.62571"
- fy="388.73516"
- fx="3496.9578"
- cy="388.73516"
- cx="3496.9578"
- gradientTransform="scale(0.78082978,1.2806889)"
- gradientUnits="userSpaceOnUse">
- <stop
- id="stop3011"
- offset="0%"
- stop-color="#F9BE03" />
- <stop
- id="stop3013"
- offset="100%"
- stop-color="#CC7C19" />
- </radialGradient>
- <radialGradient
- id="radialGradient-1-2"
- r="722.62573"
- fy="388.73517"
- fx="3496.9578"
- cy="388.73517"
- cx="3496.9578"
- gradientTransform="scale(0.78082978,1.2806889)"
- gradientUnits="userSpaceOnUse">
- <stop
- id="stop3011-5"
- offset="0%"
- stop-color="#F9BE03" />
- <stop
- id="stop3013-8"
- offset="100%"
- stop-color="#CC7C19" />
- </radialGradient>
- <radialGradient
- r="722.62573"
- fy="388.73517"
- fx="3496.9578"
- cy="388.73517"
- cx="3496.9578"
- gradientTransform="matrix(0.14560777,0,0,0.23882061,2068.5676,-690.71428)"
- gradientUnits="userSpaceOnUse"
- id="radialGradient3058"
- xlink:href="#radialGradient-1-2"
- inkscape:collect="always" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="2.8"
- inkscape:cx="-13.217746"
- inkscape:cy="194.86305"
- inkscape:document-units="px"
- inkscape:current-layer="g3017"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="2564"
- inkscape:window-height="1592"
- inkscape:window-x="0"
- inkscape:window-y="34"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Ebene 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-214.28569,-336.64789)">
- <g
- sketch:type="MSPage"
- id="Page-1"
- transform="translate(-2179.0664,1142.8264)"
- style="fill:none;stroke:none">
- <g
- sketch:type="MSArtboardGroup"
- id="plex-logo-light">
- <g
- id="g3017"
- sketch:type="MSLayerGroup">
- <path
- sketch:type="MSShapeGroup"
- id="chevron-4"
- d="m 2476.2091,-690.71428 54.0789,0 59.6729,93.28575 -59.6729,93.28575 -54.0789,0 59.6729,-93.28575 -59.6729,-93.28575"
- inkscape:connector-curvature="0"
- style="fill:url(#radialGradient3058);fill-opacity:1;stroke:none" />
- </g>
- </g>
- </g>
- </g>
-</svg>
diff --git a/skins/blackhole/xmlfiles/plug-plex-detail.xml b/skins/blackhole/xmlfiles/plug-plex-detail.xml
deleted file mode 100644
index 425d18f..0000000
--- a/skins/blackhole/xmlfiles/plug-plex-detail.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE displayplugin SYSTEM "../../../dtd/displayplugin.dtd">
-
-<displayplugin x="0" y="0" width="100%" height="100%" fadetime="0" scaletvx="0" scaletvy="0" scaletvwidth="100%" scaletvheight="100%">
-
- <viewelement name="background">
- </viewelement>
-
- <viewelement name="header">
- </viewelement>
-
- <viewelement name="footer">
- </viewelement>
-
-
-</displayplugin> \ No newline at end of file
diff --git a/skins/blackhole/xmlfiles/plug-plex-root.xml b/skins/blackhole/xmlfiles/plug-plex-root.xml
deleted file mode 100644
index 04b33c8..0000000
--- a/skins/blackhole/xmlfiles/plug-plex-root.xml
+++ /dev/null
@@ -1,405 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE displayplugin SYSTEM "../../../dtd/displayplugin.dtd">
-
-<displayplugin x="0" y="0" width="100%" height="100%" fadetime="0" scaletvx="0" scaletvy="0" scaletvwidth="100%" scaletvheight="100%">
- <!-- Available Variables time:
- {time} timestring in hh:mm
- {sec} current seconds
- {min} current minutes
- {hour} current hours
- {hmins} current "hourminutes" to display an hour hand
- {day} day in digits
- {dayleadingzero} day in digits with leading 0
- {dayname} Full name of the day
- {daynameshort} Short 3 char name of the day
- {month} month in digits with leading 0
- {monthname} Full name of the month
- {monthnameshort} 3 letter abbrivation of month name
- {year} year in yyyy
- -->
- <viewelement name="time">
-
- </viewelement>
-
- <!-- Available Variables message:
- {displaymessage} bool: message displayed?
- {message} string: message to display
- -->
- <viewelement name="message">
- <area condition="{displaymessage}" x="5%" y="80%" width="90%" height="15%" layer="98">
- <drawimage imagetype="skinpart" path="messageblue" x="0" y="0" width="100%" height="100%" />
- </area>
- <area condition="{displaymessage}" x="5%" y="80%" width="90%" height="15%" layer="99">
- <drawtext align="center" valign="center" font="{regular}" fontsize="40%" color="{clrWhite}" text="{message}" />
- </area>
- </viewelement>
-
- <!-- Tokens available in background
- {viewmode} int: enum Cover = 0, List = 1, Detail = 2
- {selecteditembackground} image
-
- {isdirectory}
- {currentdirectorybackground} image
- -->
- <viewelement name="background">
- <area x="0" y="0" width="100%" height="100%" layer="1">
- <drawimage imagetype="skinpart" path="displaymenuback" x="0" y="0" width="100%" height="100%"/>
- </area>
- </viewelement>
-
- <!-- Tokens available in header and infopane
- Same as in browser
- -->
- <viewelement name="header">
- <area layer="2" x="0" y="0" width="100%" height="15%">
- <drawtext x="1%" y="5%" width="98%" font="{light}" fontsize="30%" color="{clrWhite}" text="Plex for VDR" />
- <drawtext x="1%" y="20%" width="98%" font="{light}" fontsize="30%" color="{clrWhite}" text="{tabname}" />
- <drawimage condition="{hasbanner}" imagetype="image" path="{banner}" x="50%" y="5%" width="50%" height="90%" />
- </area>
- </viewelement>
-
- <viewelement name="infopane">
- <area layer="2" x="75%" y="15%" width="25%" height="70%">
- <drawtext x="1%" y="2%" width="98%" font="{light}" fontsize="5%" color="{clrWhite}" text="{title}" />
- <drawimage condition="{hasart}++not{isepisode}" imagetype="image" path="{art}" x="0" y="8%" width="100%" height="35%" />
- <drawimage condition="{hasthumb}++{isepisode}" imagetype="image" path="{thumb}" x="0" y="8%" width="100%" height="35%" />
- </area>
- <areascroll orientation="vertical" mode="forthandback" delay="1000" scrollspeed="medium" x="75%" y="50%" width="25%" height="40%" layer="3">
- <drawtextbox condition="isset{summary}" x="0%" y="0%" width="100%" font="{light}" fontsize="8%" color="{clrWhite}" text="{summary}" />
- </areascroll>
- </viewelement>
-
- <!-- Tokens available in browser
- {viewmode} int: enum Cover = 0, List = 1, Detail = 2
- {current} bool, currently active element
- {title} string, Name of the element
- {viewgroup} int: {UNDEF = 0, MOVIE = 1, SHOW = 2, SEASON = 3, EPISODE = 4, MUSIC, PHOTO};
-
- A dummy actually only marks a "level up"
- {isdummy} bool
-
- If the item is a server: {isserver}
- {isserver} bool
- {serverstartpointname} string
- {serverip} string
- {serverport} int
- {serverversion} string
-
-
- Following tokens are avaliable if the item is a directory or video
- {hasthumb} bool
- {thumb} string, Image/Cover
- {hasart} bool
- {art} string, Fanart
-
- If the Item is Directory following tokens are avaliable
- The item is a directory if one of the following tokens are set: {isdirectory}, {isshow}, {isseason}
-
- {isdirectory} Condition
-
- {isshow} Condition, Show/Series
- {summary} Description, plot, summary
-
- {isseason} Condition
- {summary} Description, plot, summary
-
- If the item is a video following tokens are avaliable
- The item is a video if one of the following tokens are set: {ismovie}, {isepisode}
- {contentrating} string, star-rating
- {viewoffset} int, minutes, last viewed position
- {duration} int, minutes, total duration
- {orginaltitle} original title
- {summary} Description, plot, summary
- {studio} Studio
- {year} Year of production
- {viewCount} Unseen if less than 1
-
- {videoResolution} string (sd, 720, 1080)
- {bitrate} int
- {width} int
- {height} int
- {audioChannels} int
- {aspectRatio} string (1.33, 1.78, 1.85, 2.35)
- {audioCodec} string (mp3, mp2, ac3, dca) hint: dca==DTS
- {videoCodec} string (mpeg4, msmpeg4, h264)
- {container} string (avi, mp4, mkv)
- {videoFrameRate} string (PAL, NTSC, 24p)
-
- {ismovie}
- {isepisode}
- {seriestitle} Title of the series/show
- {season} int, Season
- {episode} int, Episode, season based
- {hasbanner} bool, Bannerstyle?
- {banner} Image path
- {hasseriesthumb} bool, seriesthumb (seasoncover, seriescover)
- {seriesthumb} Image path
-
- -->
-
- <grid name="coverbrowser" x="0" y="15%" width="75%" height="75%">
- <area layer="2">
- <drawtext x="5" y="5" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="Cover" />
- <drawrectangle condition="{current}" x="0" y="0" width="100%" height="100%" color="{clrGray}" />
- </area>
- <area layer="3" condition="{ismovie}">
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawrectangle x="0" y="{height(thumb)}" width="{viewoffset}/{duration}*{areawidth}" height="2%" color="{clrBlue}" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext x="0" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{year}" />
- <drawtext x="50%" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{duration} min" />
- </area>
- <area layer="3" condition="{isepisode}" >
- <drawimage name="thumb" condition="not{hasseriesthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasseriesthumb}" imagetype="image" path="{seriesthumb}" x="0" y="0" width="100%" height="76%" />
- <drawrectangle x="0" y="{height(thumb)}" width="{viewoffset}/{duration}*{areawidth}" height="2%" color="{clrBlue}" />
- <drawtext condition="eq({viewgroup}, 4)" name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext condition="lt({viewgroup}, 4)" name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{seriestitle}" />
- <drawtext name="season" x="0" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{printf('S%02d E%02d', season, episode)}" />
- </area>
- <area layer="3" condition="{isdirectory}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isshow}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isseason}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isdummy}" >
- <drawimage name="thumb" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isserver}" >
- <drawimage name="thumb" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext x="0" y="{posy(title)} + {height(title)}" width="100%" font="{light}" fontsize="6%" color="{clrWhite}" text="{serverstartpointname}" />
- </area>
- </grid>
-
- <grid name="detailbrowser" x="0" y="15%" width="75%" height="75%">
- <area layer="2">
- <drawtext x="5" y="5" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="Detail" />
- <drawrectangle condition="{current}" x="0" y="0" width="100%" height="100%" color="{clrGray}" />
- </area>
- <area layer="3" condition="{ismovie}">
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawrectangle x="0" y="{height(thumb)}" width="{viewoffset}/{duration}*{areawidth}" height="2%" color="{clrBlue}" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext x="0" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{year}" />
- <drawtext x="50%" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{duration} min" />
- </area>
- <area layer="3" condition="{isepisode}" >
- <drawimage name="thumb" condition="not{hasseriesthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasseriesthumb}" imagetype="image" path="{seriesthumb}" x="0" y="0" width="100%" height="76%" />
- <drawrectangle x="0" y="{height(thumb)}" width="{viewoffset}/{duration}*{areawidth}" height="2%" color="{clrBlue}" />
- <drawtext condition="eq({viewgroup}, 4)" name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext condition="lt({viewgroup}, 4)" name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{seriestitle}" />
- <drawtext name="season" x="0" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{printf('S%02d E%02d', season, episode)}" />
- </area>
- <area layer="3" condition="{isdirectory}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isshow}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isseason}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isdummy}" >
- <drawimage name="thumb" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isserver}" >
- <drawimage name="thumb" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext x="0" y="{posy(title)} + {height(title)}" width="100%" font="{light}" fontsize="6%" color="{clrWhite}" text="{serverstartpointname}" />
- </area>
- </grid>
-
- <grid name="listbrowser" x="0" y="15%" width="75%" height="75%">
- <area layer="2">
- <drawtext x="5" y="5" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="List" />
- <drawrectangle condition="{current}" x="0" y="0" width="100%" height="100%" color="{clrGray}" />
- </area>
- <area layer="3" condition="{ismovie}">
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawrectangle x="0" y="{height(thumb)}" width="{viewoffset}/{duration}*{areawidth}" height="2%" color="{clrBlue}" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext x="0" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{year}" />
- <drawtext x="50%" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{duration} min" />
- </area>
- <area layer="3" condition="{isepisode}" >
- <drawimage name="thumb" condition="not{hasseriesthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasseriesthumb}" imagetype="image" path="{seriesthumb}" x="0" y="0" width="100%" height="76%" />
- <drawrectangle x="0" y="{height(thumb)}" width="{viewoffset}/{duration}*{areawidth}" height="2%" color="{clrBlue}" />
- <drawtext condition="eq({viewgroup}, 4)" name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext condition="lt({viewgroup}, 4)" name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{seriestitle}" />
- <drawtext name="season" x="0" y="{posy(title)} + {height(title)}" width="50%" font="{light}" fontsize="6%" color="{clrWhite}" text="{printf('S%02d E%02d', season, episode)}" />
- </area>
- <area layer="3" condition="{isdirectory}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isshow}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isseason}" >
- <drawimage name="thumb" condition="not{hasthumb}" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawimage name="thumb" condition="{hasthumb}" imagetype="image" path="{thumb}" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isdummy}" >
- <drawimage name="thumb" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- </area>
- <area layer="3" condition="{isserver}" >
- <drawimage name="thumb" imagetype="skinpart" path="plexplaceholder" x="0" y="0" width="100%" height="76%" />
- <drawtext name="title" x="0" y="{height(thumb)}*1.1" width="100%" font="{bold}" fontsize="6%" color="{clrWhite}" text="{title}" />
- <drawtext x="0" y="{posy(title)} + {height(title)}" width="100%" font="{light}" fontsize="6%" color="{clrWhite}" text="{serverstartpointname}" />
- </area>
- </grid>
-
- <!-- Available Variables Footer:
- {red1} true if red button is button 1
- {red2} true if red button is button 2
- {red3} true if red button is button 3
- {red4} true if red button is button 4
- {green1} true if green button is button 1
- {green2} true if green button is button 2
- {green3} true if green button is button 3
- {green4} true if green button is button 4
- {yellow1} true if yellow button is button 1
- {yellow2} true if yellow button is button 2
- {yellow3} true if yellow button is button 3
- {yellow4} true if yellow button is button 4
- {blue1} true if blue button is button 1
- {blue2} true if blue button is button 2
- {blue3} true if blue button is button 3
- {blue4} true if blue button is button 4
- {red} label of red button
- {green} label of green button
- {yellow} label of yellow button
- {blue} label of blue button
- -->
- <viewelement name="footer">
- <area condition="{red1}" x="0" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonred" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{red1}" x="0" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{red}" />
- </area>
- <area condition="{green1}" x="0" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttongreen" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{green1}" x="0" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{green}" />
- </area>
- <area condition="{yellow1}" x="0" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonyellow" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{yellow1}" x="0" y="90%" width="25%" height="10%" layer="4">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{yellow}" />
- </area>
- <area condition="{blue1}" x="0" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonblue" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{blue1}" x="0" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{blue}" />
- </area>
-
- <area condition="{red2}" x="25%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonred" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{red2}" x="25%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{red}" />
- </area>
- <area condition="{green2}" x="25%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttongreen" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{green2}" x="25%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{green}" />
- </area>
- <area condition="{yellow2}" x="25%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonyellow" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{yellow2}" x="25%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{yellow}" />
- </area>
- <area condition="{blue2}" x="25%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonblue" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{blue2}" x="25%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{blue}" />
- </area>
-
- <area condition="{red3}" x="50%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonred" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{red3}" x="50%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{red}" />
- </area>
- <area condition="{green3}" x="50%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttongreen" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{green3}" x="50%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{green}" />
- </area>
- <area condition="{yellow3}" x="50%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonyellow" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{yellow3}" x="50%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{yellow}" />
- </area>
- <area condition="{blue3}" x="50%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonblue" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{blue3}" x="50%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{blue}" />
- </area>
-
- <area condition="{red4}" x="75%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonred" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{red4}" x="75%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{red}" />
- </area>
- <area condition="{green4}" x="75%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttongreen" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{green4}" x="60%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{green}" />
- </area>
- <area condition="{yellow4}" x="75%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonyellow" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{yellow4}" x="75%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{yellow}" />
- </area>
- <area condition="{blue4}" x="75%" y="90%" width="25%" height="10%" layer="2">
- <drawimage imagetype="skinpart" path="buttonblue" align="center" valign="center" width="90%" height="60%"/>
- </area>
- <area condition="{blue4}" x="75%" y="90%" width="25%" height="10%" layer="3">
- <drawtext align="center" valign="center" font="{regular}" fontsize="50%" color="{clrWhite}" text="{blue}" />
- </area>
- </viewelement>
-
-</displayplugin>