Silverlight Plugin Help

Hey,



I’m trying to put together a new plugin that plays content from Silverlight. I’ve been stumbling around, trying to work out a suitable Site Configuration but still having difficulties. The site is SkyPlayer (http://skyplayer.sky.com - login required). I’ve written some code which POSTS the appropriate values to authenticate automatically. I then attempt to load a page which contains a Silverlight video inside it. The code is as follows:



<br />
PLAYER_URL = 'http://skyplayer.sky.com/vod/page/playLiveTv.do?epgChannelId=%s'<br />
SKY_SPORTS_ONE = "1301"<br />
<br />
<br />
def MainMenu():<br />
    dir = MediaContainer(disabledViewModes=["Coverflow"], title1 = Locale.LocalString('Title'))<br />
    <br />
    if Dict['loggedIn'] == True:<br />
        dir.Append(WebVideoItem(PLAYER_URL % SKY_SPORTS_ONE, title = "Test", subtitle = "Test"))<br />
<br />
    ....<br />




I've also started writing a Site Configuration file to try and crop/access the video. It's currently looking like:


<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<site site="http://skyplayer.sky.com"<br />
	plugin="silverlight"<br />
	initialState="playing"<br />
	version="1.0"<br />
        windowHeight="1080" <br />
        windowWidth="1920"><br />
<br />
	<crop x="0" y="0" width="0" height="0" /><br />
<br />
	<state name="playing"><br />
		<event><br />
        	<condition><br />
            	<frameLoaded /><br />
			</condition><br />
        	<action><br />
        		<!-- nothing to do here --><br />
        	</action><br />
    	</event><br />
	</state><br />
	<br />
</site><br />




What i'm finding is that when I select the menu item to attempt to play the video, I get a Plex message dialog which says "Opening Stream Test Watch TV Online | Sky Player". However, it never seems to stop and attempt to play anything. There is also nothing contained within the log files of any use. Does anyone know how best to debug this? The stream is live and therefore will really only eventually have two states, Playing and Stopped. I also know that I need to crop it properly, will this prevent it from doing anything before hand?

I've included a screenshot of a portion of the webpage, incase that's of any use.

Thanks in advance!

Hi! If you need to login to the website in order to get to the videos, you probably have to login twice: once inside your Python code if you need access to protected data there, and once inside your site config. There are a couple of things you need to do to get this working.



To have the plugin’s preference values available inside the site config, you add an identifier attribute to the site tag with the value of CFBundleIdentifier from Info.plist:


<?xml version="1.0" encoding="UTF-8"?><br />
<site site="http://skyplayer.sky.com"<br />
        plugin="silverlight"<br />
        initialState="playing"<br />
        version="1.0"<br />
        identifier="com.plexapp.plugins.xxxxxxxxxx"<br />
        windowHeight="1080" <br />
        windowWidth="1920"><br />



This way you can use the preference values entered by a user, for example: if you have a field named *username* it will be available as ${username} inside the site config.

Do you happen to know of any example site configurations that need to do this for me to have a scan over?



Unforutnatley, the code to “login” is not as easy as it could be. It requires a lot of additional POST data (which seems to be mainly generated by javascript on submit). An example of the values are as follows:



<br />
        req = HTTP.Request('https://skyplayer.sky.com/vod/content/Home/Application_Navigation/Sign_in/content/login.do', values=dict(<br />
            aaxmlrequest="true",<br />
            aazones = "content,",<br />
            machineSID = "",<br />
            mediaPlayerGUID = "",<br />
            miniclientGUID = "********************************",<br />
            clientVersionNumber = "",<br />
            nextUrl = "/index.jsp",<br />
            deliverRootLicense = "false",<br />
            userName = Prefs['username'],<br />
            password = Prefs['password'],<br />
            aazone_override = "loginerrors"))<br />




I *think* that the value of miniclientGUID is basically a key which uniquely identifies your computer. Sky manage the number of computers that you can access your account from to 3 machines. They will even only allow you to access some premium content from the registered "Main Computer". My javascript is not so good but I think this is embedded into the page and populated just before submitting.

If this is the case, will I still be able to login via the Site Configuration? If so, any suggestions/help would be greatly appreciated.

Thinking about it, I guess that I code (during the Start: method) determine the miniclientGUID and store it in the user preferences programatically. It would then be available in the Site Configuration for when it needs to authenticate. Does this sound reasonable?



If so, I guess my remaining question is back to how you authenticate against a specific URL within the Site Configurations. I think that I will need to make a POST to one address (to retrieve appropriate cookies) and then access a specific Live Stream URL.



Thanks in advance!

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