Hi,
I have just started with Channel Development and I wanted to try to make a plugin for TwitchTV. I far as I can understand it should be possible to make such a plugin. However, I find it kind of difficult to find out how to do this. I have been reading through a lot of forum posts and also the documentation, but as I do not have that much web coding(or python) experience I do not think I understand what I need to do. I do not really know what my question should be, but I will try to do my best coming up with a question that makes half-sense.
Do I need a site configuration for a TwitchTV Live stream? I have tried with this:
<site site="http://no\.twitch\.tv"<br />
plugin="plugin="http://www-cdn\.jtvnw.net/widgets/live_site_player.*\.swf"<br />
initialState="playing"<br />
version="1.0"><br />
<crop x="0" y="0" width="0" height="0" /><br />
<br />
<!-- PLAYING --><br />
<state name="playing"><br />
<event><br />
<condition><br />
<command name="pause" /><br />
</condition><br />
<action><br />
<click x="15" y="304" /><br />
<goto state="paused" /><br />
</action><br />
</event><br />
</state><br />
<br />
<!-- PAUSED --><br />
<state name="paused"><br />
<event><br />
<condition><br />
<command name="play" /><br />
</condition><br />
<action><br />
<click x="15" y="304" /><br />
<goto state="playing" /><br />
</action><br />
</event><br />
</state><br />
</site>
I do not know if I should have the http:// in front of the site and plugin tag or not. In the channel code I have been copying and pasting from different examples I have found and ended up trying with this:
NAME = "TwitchTEST"<br />
URL = "http://www-cdn.jtvnw.net/widgets/live_site_player.r8aecbbcea76a272aa00ed8966e40dafbbdb62ccf.swf"<br />
WIDTH = 620<br />
HEIGHT = 378 <br />
<br />
ART = 'art-default.png'<br />
ICON = 'icon-default.png'<br />
<br />
<br />
def Start():<br />
<br />
# Initialize the plugin<br />
Plugin.AddPrefixHandler(VIDEO_PREFIX, MainMenu, NAME, ICON, ART)<br />
Plugin.AddViewGroup("List", viewMode = "List", mediaType = "items")<br />
Plugin.AddViewGroup("MyDetailViewGroupName", viewMode="InfoList")<br />
# Setup the artwork associated with the plugin<br />
MediaContainer.title1 = NAME<br />
MediaContainer.viewGroup = "List"<br />
MediaContainer.art = R(ART)<br />
DirectoryItem.thumb = R(ICON)<br />
DirectoryItem.art = R(ART)<br />
VideoItem.thumb = R(ICON)<br />
VideoItem.art = R(ART)<br />
<br />
# This main function will setup the displayed items.<br />
def MainMenu():<br />
dir = MediaContainer(viewMode= "List")<br />
dir.Append(Function(DirectoryItem(LiveMenu, "Live")))<br />
return dir<br />
<br />
def LiveMenu(sender):<br />
dir = MediaContainer(viewMode = "List")<br />
dir.Append(Function(WebVideoItem(MediaContainerTest, title="TwitchTest", subtitle=None, thumb=None), url=URL))<br />
<br />
return dir<br />
<br />
def MediaContainerTest(sender, url):<br />
dir = MediaContainer()<br />
Log(url)<br />
return Redirect(WebVideoItem(url))
In the Plex Media Server.log I get this error:
Dec 08, 2012 23:28:28:732 [8008] DEBUG - * url => http://www-cdn.jtvnw.net/widgets/live_site_player.r8aecbbcea76a272aa00ed8966e40dafbbdb62ccf.swf<br />
Dec 08, 2012 23:28:28:733 [8008] DEBUG - * prefix => /video/example<br />
Dec 08, 2012 23:28:28:733 [8008] DEBUG - WebKit: [www-cdn.jtvnw.net/widgets/live_site_player.r8aecbbcea76a272aa00ed8966e40dafbbdb62ccf.swf]<br />
Dec 08, 2012 23:28:28:733 [8008] DEBUG - Found corresponding plug-in: C:\Users\User\AppData\Local\Plex Media Server\Plug-in Support\Data
o.user.plugins.twitchtv<br />
Dec 08, 2012 23:28:28:733 [8008] DEBUG - Could not find site configuration for http://www-cdn.jtvnw.net/widgets/live_site_player.r8aecbbcea76a272aa00ed8966e40dafbbdb62ccf.swf<br />
Dec 08, 2012 23:28:28:733 [8008] ERROR - ERROR: Couldn't find configuration.<br />
Dec 08, 2012 23:28:28:733 [8008] ERROR - WebKit: Could not initiate capture.
Am I totally off here? I kinda find it hard to find out how I should do this. I will be grateful for any suggestions:)