I now have all the nice streaming=URLs from my web site.
e.g.:
rtsp://ondemand.msmedia.zdf.newmedia.nacamar.net/zdf/data/msmedia/zdf/09/03/090330_limes1_tex_vh.wmv
or
http://blip.tv/file/get/Demnow-DemocracyNo…ch272009844.mp4
But now I am lost on how to give it back to PLEX to have it played …
I tried to make a mediacontainer with video items … but this seams not to work corretly … the items do not show as a list at all …
I tried to REDIRECT to a URL … but this does not work either …
Any ideas? … I looked a various plug-ins … but still could not get it to work ?!
Can you post the code so we can have a look? Thanks 
Here it is:
[codebox]
…
dir = MediaContainer(art=R(“art-default.png”), title1=TopLevel, title2=Section)
for item in ThirdPage:
URL, DATE, TITLE, DURATION, DESCRIPTION, THUMB= item
# ‘URL’ will be used to reference the station when selected on FrontPage
# VideoItem(key=key, title=title, subtitle=subtitle, summary=summary, duration=duration, thumb=thumb, art=art, **kwargs)
# DirectoryItem( key, title, subtitle=None, summary=None, thumb=None, art=None, **kwargs)
dir.Append(Function(DirectoryItem(PlayVideo,
title = DATE+’ (’+DURATION.rstrip()+’): ‘+TITLE,
subtitle= “joJo”,
summary = None,
thumb = THUMB,
art=R(“art-default.png”)), url = URL))
#dir.Append(Function(VideoItem(URL,
# title = DATE+’ (’+DURATION.rstrip()+’): '+TITLE,
# subtitle=Section,
# duration=DURATION,
# thumb=THUMB,
# art=R(“art-default.png”))))
return dir
def PlayVideo(sender, url):
Log(‘Reditect to: %s’ % url)
#url = "http://blip.tv/file/get/Demnow-DemocracyNowFridayMarch272009844.mp4 "
return Redirect(url)
[/codebox]
I build up a list (ThirdPage ) of tuples with all the information for a FINAL page …
displaying the actual video items.
Now when I use “dir.Append(Function(DirectoryItem(…” to build the final page …
I get a nice list of items, yet I can not PLAY any of them (call to PlayVideo works)
You’re appending DirectoryItems to the third page, so Plex is expecting you to be returning another directory. Also, for something simple where you already have the full URL to the video file, you don’t need to use a function or redirect - they’re only required when you have to do some sort of computation to get the final URL. You can just append a new VideoItem to the MediaContainer with the URL as the key, and it’ll play 
e.g. dir.Append(VideoItem(url, title))
A couple more tips: you don’t need to set the art attribute for each item, you can just set it on the MediaContainer & it’ll be used for all items. Furthermore, you can set the attribute directly on the class in the plug-in’s Start method & it’ll be used for all containers you create after that, e.g. MediaContainer.art = R(“art-default.png”)
mmmhhh I made some progress … the container is filling up nicely with"plain" video items.
Now when I click one any of them I gt nothing or a msg: "The play list is empty… or the file got moved?!"something like this. BUT no video plays.
Here is a snipplet to show what I mean:
[codebox]# -- coding: utf-8 --
This Plug-In is showing some video playback errors
from PMS import *
from PMS.Objects import *
from PMS.Shortcuts import *
PLUGIN_PREFIX = "/video/TestVideo"
################################################################################
####################
def Start():
# Add the MainMenu prefix handler
Plugin.AddPrefixHandler(PLUGIN_PREFIX, MainMenu, L('Show the Error'), 'icon-default.png', 'art-default.jpg')
# Set up view groups
Plugin.AddViewGroup("List", viewMode="List", mediaType="items")
# Set the default cache time
HTTP.SetCacheTime(14400)
# Set the default MediaContainer attributes
MediaContainer.title1 = 'Show the Error'
MediaContainer.content = 'List'
MediaContainer.art = R('art-default.jpg')
################################################################################
####################
def MainMenu():
#dir.Append(Function(DirectoryItem(asv, title="Guests")))
Log("MAIN Call!")
dir = MediaContainer(art = R("art-default.png"), title1="COMPIZmediacenter", viewGroup="List")
dir.Append(Function(DirectoryItem(PlayVideo, title = "Titel", subtitle= "Sub Title", summary = "Summary", thumb = None, art=R("art-default.png"))))
return dir
def PlayVideo(sender):
dir = MediaContainer()
# Sample #1 Works in PLEX & FireFox ==> Quicktime
dir.Append(VideoItem("http://blip.tv/file/get/Demnow-DemocracyNowFridayMarch272009844.mp4 " , "Sampe #1 (OK)"))
# Sample #2 does NOT work in PLEX & Quicktime "Unsupported Transport"
# CHANGING the "rtsp" to "http" makes it play within the Windows Media Player for MAC
# WORKS in VLC with 'rtsp' or 'http' protocol header
dir.Append(VideoItem("rtsp://ondemand.msmedia.zdf.newmedia.nacamar.net/zdf/data/msmedia/zdf/09/04/090427_flamm_hid_vh.wmv" , "Sample #2 (ERROR)"))
# Sample #3 ==> see Sample #2 ... I changed 'rtsp' to 'http'
dir.Append(VideoItem("http://ondemand.msmedia.zdf.newmedia.nacamar.net/zdf/data/msmedia/zdf/09/04/090424_h12_vh.wmv" , "Sample #3 (ERROR)"))
# Sample #4 Works in PLEX & FireFox ==> Quicktime
dir.Append(VideoItem("http://de.clip-1.filmtrailer.com/1730_33q55_2_5.mov?log_var=73|491100074-1|-" , "Sample #4 (OK)"))
# Sample #5 does NOT work in PLEX & Quicktime "Unsupported Transport"
dir.Append(VideoItem("rtsp://a692.v253457.c25345.g.vm.akamaistream.net/7/692/25345/v0001/video.daserste.de/videoportal/Film/c_70000/72918/format71495.wmv?sen=Quiz-Shows+im+Ersten&for=Video-16%3A9-Web+M-WMV9%2C+Audio-Stereo-WMA9" , "Sample #5 (ERROR)"))
# Sample #6 does NOT work in PLEX & Quicktime "Unsupported Transport"
# WORKS in VLC
dir.Append(VideoItem("rtsp://a166.v397598.c39759.g.vm.akamaistream.net/7/166/39759/d1d9e93369553d08031a2838918cc5fd/artegeie.download.akamai.com/39759/mfile/arteprod/A7_SGT_ENC_04_039037-001-A_PG_HQ_DE.wmv" , "Sample #6 (ERROR)"))
# Sample #7 works in FireFox => Quicktime ... BUT NOT in PLEX
dir.Append(VideoItem("rtsp://prana.mc.maricopa.edu/realqt.mov", "Sample #7 (ERROR)"))
return dir
[/codebox]
Q: I think its not my CODE but rather something else? Do I have to set a flag to play certain kinds of streams?
BTW, the intial problem I had was related to DURATION, which needs to be an INT ... I had put a STRING there ...
ALSO, is it possible to HIGHLIGHT a selection just when you click it and plex tries to do its thing? When plex gives back control to the plug-in the HIGHLIGHT should be reversed.
Are you certain Plex is actually capable of playing these streams? You can test by adding the URL to a .strm file, then trying to play the file in Plex.
The type of the duration attribute shouldn’t matter - they all get converted to strings before being passed back to Plex. I’m not exactly sure what you mean by the highlight part!
Thanks for the QUICK reply :-)
I am not sure ... but thought: if the M-PLAYER-CLASSIC can play it .. then plex should too? Its based on the same ffmpeg libraries?!
I will try to create stream files ... I guess I can use these instructions?: [http://xbmc.org/wiki/?title=HOW-TO:_Play_Internet_Streams](http://xbmc.org/wiki/?title=HOW-TO:_Play_Internet_Streams)
**** UPDATE ****
Apparently the below mentioned exception when the DURATION attribute was fed with a string was not correct ... it seams to work now !
DURATION attribute ... throws an exception when fed with a string ("00:03") ... given an INT (3000) it works.
HIGHLIGHT: When I have a list of ITEMS within a media container ... displayed within PLEX:
- Select an ITEM by clicking on it ==> TITLE gets **HIGHLIGHTED**
-> PLEX takes the slection and does something ...
-> PLEX is done working ==> REVERSE the HIGHLIGHTED
-> Plug-in gets "focus" / control again.
I am not 100% sure, but I guess this ticket is till open?
https://plexapp.lighthouseapp.com/projects/14382/tickets/248
It says that *.MWV files are not yet supported?!
UPDATE: I found this for ffmpeg:
http://www.mail-archive.com/ffmpeg-issues@…g/msg00494.html
Apparently its a known bug … is it possible to skip the first 20 sec. or so of a stream with some switches / flags set when the ffmpeg modules are called?
Any updates on the 248 ticket?
I am not sure about the ticket ... but WMV files are supported ... and I can play them ... some issues are around the VERSION ... but with the latest PLEX I do not have any stream I can not play.
Some streams however need a different HEADER (HTTP instead of RTSP)
Hope this helped?!
Exactly, the units are milliseconds :)
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.