CBC News at Six

OK, so been reading some of the information on how to code for PLEX plug-in … but a bit confused (MAC NEWBIE). Trying to contribute. Thinking on creating an entry into the Video plug-in titled “CBC News at Six” which once you select, you can choose which news broadcast you would like to stream (eg Toronto, Ottawa, etc). Based on samples I have been able to see on this site. Any good samples that folks might suggest? Not sure that this will do it, but willing to collaborate with any of the plug-in gurus.



# -*- coding: utf-8 -*-<br />
<br />
# This Plug-In for CBC News at 6<br />
<br />
from PMS import *<br />
from PMS.Objects import *<br />
from PMS.Shortcuts import *<br />
<br />
PLUGIN_PREFIX = "/video/CBC_News"<br />
<br />
################################################################################<br />
def Start():<br />
<br />
# Add the MainMenu prefix handler<br />
	Plugin.AddPrefixHandler(PLUGIN_PREFIX, MainMenu, L('Show the Error'), 'icon-default.png', 'art-default.jpg')<br />
<br />
# Set up view groups<br />
	Plugin.AddViewGroup("List", viewMode="List", mediaType="items")<br />
<br />
# Set the default cache time<br />
	HTTP.SetCacheTime(14400)<br />
<br />
# Set the default MediaContainer attributes<br />
	MediaContainer.title1 = 'CBC News at 6'<br />
	MediaContainer.content = 'List'<br />
	MediaContainer.art = R('art-default.jpg')<br />
<br />
################################################################################<br />
<br />
def MainMenu():<br />
#dir.Append(Function(DirectoryItem(asv, title="Guests")))<br />
<br />
	Log("MAIN Call!")<br />
	dir = MediaContainer(art = R("art-default.png"), title1="CBC News at Six", viewGroup="List")<br />
	dir.Append(Function(DirectoryItem(PlayVideo, title = "Title", subtitle= "Sub Title", summary = "Summary", thumb = None, art=R("art-default.png"))))<br />
<br />
return dir<br />
<br />
<br />
def PlayVideo(sender):<br />
<br />
dir = MediaContainer()<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/winnipeg.wmv" , "Manitoba"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/montreal.wmv" , "Montreal"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/ondemand/newsatsix/fredericton.asx" , "New Brunswick"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/stjohns.wmv" , "New Foundland"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/halifax.wmv" , "Nova Scotia"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/ottawa.wmv" , "Ottawa"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/compass/compass.wmv" , "PEI"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/regina.wmv" , "Saskatchewan"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/toronto.wmv" , "Toronto"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/vancouver.wmv" , "Vancouver"))<br />
	dir.Append(VideoItem("http://www.cbc.ca/mrl3/8752/newsatsix/windsor.wmv" , "Windsor"))<br />
return dir

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.