I finally got some time to re-write the Site Configuration (again :)) as suggested Sander1. I came up with the following:
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<site site="http://skyplayer.sky.com"<br />
plugin="silverlight"<br />
identifier="com.plexapp.plugins.skyplayer"<br />
initialState="wait-for-frame-load"<br />
version="1.0"><br />
<br />
<!-- The condition we use several times from within states to check if we're logged in or not --><br />
<condition name="need-to-login"><br />
<and><br />
<!-- Check if a specific element exists in the page, for example the loginform --><br />
<!-- Returns true if we need to login --><br />
<javascript script="document.cookie.indexOf('; skySSO=')" matches="-1" /><br />
</and><br />
</condition><br />
<br />
<state name="wait-for-frame-load"><br />
<event><br />
<condition><br />
<!-- Wait for the DOM to load... --><br />
<frameLoaded /><br />
</condition><br />
<action><br />
<!-- ...then goto the 'check-for-auth' state --><br />
<goto state="check-for-auth" /><br />
</action><br />
</event><br />
</state><br />
<br />
<state name="check-for-auth"><br />
<event><br />
<condition><br />
<!-- If we don't need to login, goto state 'playing' --><br />
<not><br />
<condition name="need-to-login" /><br />
</not><br />
</condition><br />
<action><br />
<goto state="playing" /><br />
</action><br />
</event><br />
<event><br />
<!-- If we *do* need to login, fill in the form and post it --><br />
<condition><br />
<condition name="need-to-login" /><br />
</condition><br />
<action><br />
<visit url="https://skyplayer.sky.com/vod/content/Home/Application_Navigation/Sign_in/content/login.do"/><br />
<goto state="login"/><br />
</action><br />
</event><br />
</state><br />
<br />
<state name="login"><br />
<event><br />
<condition><br />
<javascript script="true ? 1 : 0" matches="1" /><br />
</condition><br />
<action><br />
<run script="page='${url}';index=page.indexOf('/page/');document.login.userName.value='${username}';document.login.password.value='${password}';document.login.nextUrl.value=page.substring(index);document.login.submit();" /><br />
<pause time="5000" /><br />
<visit url="${url}" /><br />
<goto state="check-for-auth-again" /><br />
</action><br />
</event><br />
</state><br />
<br />
<state name="check-for-auth-again"><br />
<event><br />
<condition><br />
<!-- If login was successful we should now not need to login and can go to the state 'playing' --><br />
<not><br />
<condition name="need-to-login" /><br />
</not><br />
</condition><br />
<action><br />
<goto state="playing" /><br />
</action><br />
</event><br />
<event><br />
<condition><br />
<!-- If we still need to login after we've tried to login, something is wrong... --><br />
<condition name="need-to-login" /><br />
</condition><br />
<action><br />
<goto state="end" param="Please check your username and password in the plugin's settings" /><br />
</action><br />
</event><br />
</state><br />
<br />
<!-- Playing --><br />
<state name="playing"><br />
<event><br />
<condition><br />
<javascript script="true ? 1 : 0" matches="1" /><br />
</condition><br />
<br />
<action><br />
<!-- Do Nothing --><br />
</action><br />
</event><br />
</state><br />
<br />
</site><br />
However, this is still causing the exact same problem as mentioned above. It seems that the Plex framework is identifying an unknown sliverlight component (Xaml1) and displaying that instead of the correct one (silverlightControl). Here's the log:
<br />
Apr 13, 2011 22:07:35 [0xa0a75540] DEBUG - Received title [Sky Player].<br />
Apr 13, 2011 22:07:35 [0xa0a75540] DEBUG - Frame was loaded.<br />
Apr 13, 2011 22:07:35 [0xa0a75540] DEBUG - Executing Moving to state check-for-auth<br />
Apr 13, 2011 22:07:35 [0xa0a75540] DEBUG - Executed 'document.cookie.indexOf('; skySSO=')' and now seeing if [-1] matches [-1]<br />
Apr 13, 2011 22:07:35 [0xa0a75540] DEBUG - Executed 'document.cookie.indexOf('; skySSO=')' and now seeing if [-1] matches [-1]<br />
Apr 13, 2011 22:07:35 [0xa0a75540] DEBUG - Executing Visiting https://skyplayer.sky.com/vod/content/Home/Application_Navigation/Sign_in/content/login.do<br />
Apr 13, 2011 22:07:35 [0xa0a75540] DEBUG - Browsing to URL: https://skyplayer.sky.com/vod/content/Home/Application_Navigation/Sign_in/content/login.do<br />
Apr 13, 2011 22:07:35 [0xa0a75540] DEBUG - Stopping execution, waiting for 1<br />
Apr 13, 2011 22:07:36 [0xa0a75540] DEBUG - Frame was loaded.<br />
Apr 13, 2011 22:07:36 [0xa0a75540] DEBUG - Executing Moving to state login<br />
Apr 13, 2011 22:07:36 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:07:36 [0xa0a75540] DEBUG - Executing Javascript(page='${url}';nextPageIndex=page.indexOf('/page');document.login.userName.value='${username}';document.login.password.value='${password}';document.login.nextUrl.value=page.substring(nextPageIndex);document.login.submit();)<br />
Apr 13, 2011 22:07:36 [0xa0a75540] DEBUG - Executing Pausing 5000ms<br />
Apr 13, 2011 22:07:36 [0xa0a75540] DEBUG - Stopping execution, waiting for 2<br />
Apr 13, 2011 22:07:36 [0xa0a75540] DEBUG - Got frame loaded, was waiting for something else.<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - Got frame loaded, was waiting for something else.<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - Got frame loaded, was waiting for something else.<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - Got frame loaded, was waiting for something else.<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - Got frame loaded, was waiting for something else.<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - Got frame loaded, was waiting for something else.<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - Got frame loaded, was waiting for something else.<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - 0x16a3e670 Plugin loaded [data:application/x-silverlight,] (0 0 300 300 Xaml1)<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - Got a URL, was waiting for something else.<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - Got frame loaded, was waiting for something else.<br />
Apr 13, 2011 22:07:39 [0xa0a75540] DEBUG - Initializing shared memory 300 x 300<br />
Apr 13, 2011 22:07:41 [0xa0a75540] DEBUG - Got a URL, was waiting for something else.<br />
Apr 13, 2011 22:07:41 [0xa0a75540] DEBUG - Plug-in changed frame size to 300 x 300<br />
Apr 13, 2011 22:07:41 [0xa0a75540] DEBUG - Initializing shared memory 300 x 300<br />
Apr 13, 2011 22:07:47 [0xa0a75540] DEBUG - Timer Expired.<br />
Apr 13, 2011 22:07:49 [0xa0a75540] DEBUG - Frame was loaded.<br />
Apr 13, 2011 22:07:49 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:07:49 [0xa0a75540] DEBUG - Executing Javascript(page='${url}';nextPageIndex=page.indexOf('/page');document.login.userName.value='${username}';document.login.password.value='${password}';document.login.nextUrl.value=page.substring(nextPageIndex);document.login.submit();)<br />
Apr 13, 2011 22:07:49 [0xa0a75540] DEBUG - Executing Pausing 5000ms<br />
Apr 13, 2011 22:07:49 [0xa0a75540] DEBUG - Stopping execution, waiting for 2<br />
Apr 13, 2011 22:07:54 [0xa0a75540] DEBUG - Timer Expired.<br />
Apr 13, 2011 22:07:54 [0xa0a75540] DEBUG - Executing Visiting ${url}<br />
Apr 13, 2011 22:07:54 [0xa0a75540] DEBUG - Browsing to URL: http://skyplayer.sky.com/vod/page/detachedSampleStream.do<br />
Apr 13, 2011 22:07:54 [0xa0a75540] DEBUG - Stopping execution, waiting for 1<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - Frame was loaded.<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - Executing Moving to state check-for-auth-again<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - Executed 'document.cookie.indexOf('; skySSO=')' and now seeing if [480] matches [-1]<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - Executing Moving to state playing<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - Executed 'document.cookie.indexOf('; skySSO=')' and now seeing if [480] matches [-1]<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - 0x16a845d0 Plugin loaded [data:application/x-silverlight,] (0 0 1024 698 silverlightControl)<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:00 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:00 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:02 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:02 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:02 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:02 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:03 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:04 [0xa0a75540] DEBUG - Executed 'true ? 1 : 0' and now seeing if [1] matches [1]<br />
Apr 13, 2011 22:08:07 [0xb0a31000] DEBUG - LINE: STOP<br />
Apr 13, 2011 22:08:07 [0xb0a31000] DEBUG - Stream closed.<br />
Apr 13, 2011 22:08:07 [0xb0a31000] DEBUG - Stream closed.<br />
As you can see from the log, there is the following line:
<br />
Apr 13, 2011 22:07:38 [0xa0a75540] DEBUG - 0x16a3e670 Plugin loaded [data:application/x-silverlight,] (0 0 300 300 Xaml1)<br />
This appears to be received from the URL and displayed showing the random Clear/Refresh buttons in my first posting. However, a little later on, it manages to find the correct silverlight control:
<br />
Apr 13, 2011 22:07:55 [0xa0a75540] DEBUG - 0x16a845d0 Plugin loaded [data:application/x-silverlight,] (0 0 1024 698 silverlightControl)<br />
This means that if you simply wait, you can hear the audio but not see any video. Any ideas?