Skip to main content
Home Forums General Silverlight Hosting and Streaming Crossdomain hosting of XAP for easy embed?
11 replies. Latest Post by KirillOsenkov on November 1, 2009.
(0)
scs32
Member
0 points
4 Posts
06-12-2009 1:33 PM |
The goal is simple: I want to create an <object /> type tag which people can include on blogs, webpages, etc. without needing anything but the snippet of code.
However, when I set the source to anything but the same domain, I get a blank screen. As this is a VERY VERY VERY basic concept, I have a hard time believing I'm not being an idiot. That said, people who have asked similar questions either get no response or, get this, IFRAMES come up. IFRAMES? Really? IFrames?
This is possible, right?
ken tucker
All-Star
16288 points
2,485 Posts
06-12-2009 2:07 PM |
Microsoft Silverlight Streaming uses IFrames
06-12-2009 4:18 PM |
Maybe I'm not being clear...
Are you saying that there is no clean way for people to simply embed a Silverlight player in a webpage/blog/etc. Really? Really? In this day and age of social media/blogs/etc....
I started down the road of Silverlight thinking "MSFT Version of Flash." In a million years I wouldn't guess that you can't hand out the same "Embed" concept that's in just about every Flash player out there.
I have to think that I'm somehow being unclear...
clint1222
Participant
1542 points
216 Posts
06-12-2009 5:48 PM |
Hi,
You could just give out the object tag information to your Silverlight xap file. Update the source value to include full URL information to your xap file.
There isn't a "Silverlight player", it's a browser plug-in the end-user would have to have installed to view the app. Otherwise they would see the "Get Silverlight" install message.
Perhaps your source was incorrect. Can we take a look at the object tag code?
06-12-2009 6:00 PM |
If I do something like:
<object id="SilverlightMediaPlayer" width="100%" height="100%" autoupdate="true" type="application/x-silverlight-2"><param name="enableHtmlAccess" value="true" /> <param name="MinRuntimeVersion" value="2.0.31005.0" /> <param name="Source" value='/videoplayer/AdaptiveStreamingStatsTracker.xap' /> <param name="windowless" value="false" />
<param name="InitParams" value='fakemode=,background=#FF000000,autoplay=False,muted=False,stretchmode=0,playlist=<playList><playListItems><playListItem title="Experience Smooth Streaming : The Official Microsoft IIS Site" description="" mediaSource="mediaurl" adaptiveStreaming="True" thumbSource=""></playListItem></playListItems></playList>' /> <a style="text-decoration: none;" href="http://go.microsoft.com/fwlink/?LinkID=92799"> <img style="border-width:0px" alt="Install Silverlight" src='http://i3.iis.net/themes/iis/images/slplayer_disabled.png?cdn_id={d0438422}' /> </a>
</object>
Everything is great. However, if I change the Source value to include a website from a different domain name, everything breaks down.
06-12-2009 7:06 PM |
I would imagine there would have to be either a clientaccesspolicy.xml file in place or a crossdomain.xml file in place to access the resources. I can find the xap file and look inside but I can't find any policy files. That object wouldn't work on a different domain page.
Have you created a Silverlight app available to other pages?
dmacdonald
22 points
17 Posts
09-01-2009 10:21 PM |
I have the same problem. Here is my html code.
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}
<div id="silverlightControlHost"> <object height="300" width="300" type="application/x-silverlight-2" data="data:application/x-silverlight-2,"> <param value="http://a-remote-domain.com/ClientBin/SilverlightClient.xap" name="source"/> <param value="white" name="background"/> <param value="3.0.40723.0" name="minRuntimeVersion"/> <param value="true" name="enableHtmlAccess"/> <param value="visOnly=true" name="initParams"/> <a style="text-decoration: none;" href="http://go.microsoft.com/fwlink/?LinkID=149156"> <img style="border-style: none; width: 400px; height: 200px;" alt="Install Microsoft Silverlight" src="http://storage.timheuer.com/sl4wp-ph.png"/></a></object> <iframe style="border: 0px none ; visibility: hidden; height: 0pt; width: 0pt;"/></div>
My clientaccesspolicy.xml is in place and allows web services to be called remotely from all domains, although I dont see how that has direct bearing on this issue. The xap works fine when the url points to a local copy of it. In the scenario above I do not even see an http request go out for the xap, its as if the silverlight plugin decides it doesnt want to even bother fetching it. On the remote host, IIS claims that the mime-type is set correctly.
This is a pretty major class of fail for silverlight, but I know _someone_ has got this working. Any ideas guys?
Daniel
09-01-2009 10:28 PM |
It's my understanding that everything is working as it should. This is just not something that they allow. IIRC, it was for security reasons. To the best of my knowledge you'll need to use iframes where the remote server will actually host a page and you place that "page" in an iframe.
09-02-2009 1:56 PM |
This working example
http://www.rhizohm.net//irhetoric/blog/99/default.aspx
and Tim Heuer's wordpress plugin both imply that it should be possible without iframes....I just cant figure out what I'm doing wrong.
09-02-2009 2:26 PM |
Hi Daniel,
A couple of quick things to check. The clientaccesspolicy.xml file is located at the host of the xap file ( http://a-remote-domain.com) correct?
Also, IIS doesn't recognize the clientaccesspolicy.xml file right away, it requires a restart.
09-02-2009 2:41 PM |
Yes it is, and its been restarted many times, and I know it works at least for my web services...
KirillOs...
4 points
2 Posts
11-01-2009 7:54 PM |
Make sure that the .html file where you're putting the <object> tag is on a web server, not on the local filesystem. It will only work when the .html is loaded from the http: (the web) but not file: (local filesystem). http://localhost should work.
Hope this helps,
Kirill