views:

34

answers:

0

I'm working on manipulating SL2 to be an audio player and has markers. However, when a marker is reached I'd like to manipulate the marker metadata via javascript. I see that he has allowed certain variables to be manipulated via javascript and I just want to add onto that. Any ideas? I have tried adding a scriptable member method in the page.xaml.cs but I can't seem to get access to it via the javascript.

 [ScriptableMember]
    public string MarkerHit(string marker)
    {
        return marker;
    }

In my page I define the player as:

<object id="Player" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="500" height="40">
 <param name="source" value="ClientBin/VideoPlayer.xap" />
 <param name="initParams" value="m=scriptTest.wma,autohide=false,markers=true" />
</object>

<script type="text/javascript">
    var sl = document.getElementById("Player");
    var content = sl.Content.Page;
    var slideNumber = content.MarkerHit();
    alert(slideNumber);   

</script>

The script to get the player I got from another page but obviously s1 has no content field so I can't access the page. Any ideas?