Here's a summary of my current problem:
[list]
[*] If I give a stream URL (this is an hdhomerun stream url) as the first arg to VideoItem, then it plays just fine, but all attempts to change the thumb icon setting fail, due to some form of caching that appears to happen. Not only can I not change the icon dynamically, but the icon setting is fixed even across restarts, so that only removing the userdata/Thumbnails/Video directory can I get a new value.
[*] All my other non-VideoItem items uses callbacks as their first arg, and changing the icons dynamically on them works just fine. Note that all my containers have "noCache=True".
[*] If I change the first arg of VideoItem to be a callback, then I can dynamically change the icons on the VideoItem, but I cannot figure out what to return to make the stream play. Ive tried returning the stream as a string url, as a VideoItem, and a s a VideoItem wrapped in a Redirect(), and all variations seem to give the same behavior: "Error: could not determine input format". I am not sure if I am doing something wrong, or if this is causing the server to take a different code path where the hdhomerun stream urls are not being recognized.
[/list]
So I am looking for a solution to my problem by either one of these methods:
[list]
[*] Figuring out how to change the icon (get around the cache) for a VideoItem when the first arg is a stream url as a string
[*] Figuring out what to return from the VideoItem callback to get this stream to play.
[/list]
For informational purposes, I also would not mind insight into either of the following:
[list]
[*] I have see examples in the forums of the VideoItem callback returning a string, a VideoItem and a Redirect-wrapped VideoItem, so which is supposed to be right?
[*] How does the icon caching strategy work that would explain why most of my icons can dynamically change, but VideoItems cannot?
[/list]
Finally, here's some of the code snippets relevant to my problem:
Code where playing stream works, but the icon does not change:
dir.Append( VideoItem( streamUrl,<br />
"%s %s" % ( L('Watch'), channel.getTitle()),<br />
subtitle=channel.getSubtitle(),<br />
summary=channel.Resolution,<br />
thumb=R(GetChannelImageName(channel)),<br />
art=R(ART)<br />
))<br />
Code where changing icon works, but stream does not play (with 3 different return variations):
dir.Append( Function(<br />
VideoItem( PlayStreamCallback,<br />
"%s %s" % ( L('Watch'), channel.getTitle()),<br />
subtitle=channel.getSubtitle(),<br />
summary=channel.Resolution,<br />
thumb=R(GetChannelImageName(channel)),<br />
art=R(ART)<br />
),<br />
lineupId=lineup.getId(),<br />
channelId=channel.getId() ))<br />
<br />
def PlayStreamCallback(sender, lineupId, channelId ):<br />
channel = GetChannelById( lineupId, channelId )<br />
deviceId = Prefs.Get(DEVICE_ID)<br />
tunerId = Prefs.Get(TUNER_ID)<br />
streamUrl = channel.getStreamUrl( deviceId, tunerId )<br />
# Variant 1<br />
return streamUrl<br />
# Variant 2<br />
return VideoItem( streamUrl, channel.getTitle() )<br />
# Variant 3<br />
return Redirect( VideoItem( streamUrl, channel.getTitle() ))<br />
My Plugin is 99.9% completed...and this problem is the 0.1% remaining.
Thanks for any insights.
-tony