Hi guys, I need some help with the createobject function in Silverlight. My xap file accepts a video url and loads it for playing. When I write a tag as follows, it works fine.
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
width="100%" height="100%">
<param name="source" value="ClientBin/VideoPlayer.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="2.0.31005.0" />
<param name="autoUpgrade" value="true" />
<param name="MediaSource" value="video.wmv" />
</object>
Although when I try to create this object using Silverlight.createObject, it does not play any video.
Silverlight.createObject(
"ClientBin/VideoPlayer.xap",
document.getElementById('silverlightHost'),
"slPlugin",
{
width: "400", height: "300",
background: "Black",
isWindowless: "true",
version: "2.0.31005.0",
alt: "fg"
},
{ onError: onSilverlightError },
"MediaSource=video.wmv",
"context"
);
Am I missing something silly here.