Howdy,
We’d like to track the total number of video/picture views from the Plex plug-in. From the documentation, it appears that it’s possible to assign a callback function for an individual PhotoItem or VideoItem but my attempt down this road has failed.
Anyone know how to accomplish this?
Thanks!
Hi! You can do some things before starting the video by using a Function with the (Web)VideoItem, like so:
For a WebVideoItem:
<br />
# ...building a list with items here<br />
dir.Append(Function(VideoItem(PlayVideo, title=title), url=url))<br />
<br />
####################################################################################################<br />
<br />
def PlayVideo(sender, url):<br />
Log('Hey, were in PlayVideo!')<br />
# Find the final video, and/or do some tracking/logging stuff here<br />
<br />
return Redirect(url)<br />
For a VideoItem:
<br />
# ...building a list with items here<br />
dir.Append(Function(WebVideoItem(PlayVideo, title=title), url=url))<br />
<br />
####################################################################################################<br />
<br />
def PlayVideo(sender, url):<br />
Log('Hey, were in PlayVideo!')<br />
# Find the final video, and/or do some tracking/logging stuff here<br />
<br />
return Redirect(WebVideoItem(url))<br />
Works perfectly - Thank you!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.