Need to make my Silverlight control transparent to the underlying HTML. Am doing it the way I've seen it done before but something's not jiving...
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
width="640px" height="296px">
<param name="source" value="ClientBin/slvStartPage.xap" />
<param name="onError" value="onSilverlightError" />
<param name="pluginbackground" value="Transparent" />
<param name="iswindowless" value="true" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"
style="border-style: none" />
</a>
</object>
The param names are incorrect:-
iswindowless -> windowless
pluginbackground -> background
Of course the control you assign to Application.RootVisual also needs a transparent background and anything else that may fill its space.
Related
I have a website that consists mainly of a single Silverlight application. The website is configured to run over HTTPS which works great. However when the site is loaded in Chrome the warning is given that
"The page at https://testing.efilecabinet.com/ displayed insecure content from http://download.microsoft.com/download/5/1/6/5165823D-1D79-4871-8AC2-42DDDB94A5C2/PNGs/SLMedallion_ENU.png."
It seems that the SL framework is loading this image from microsoft over HTTP. Does anyone know of a way to get this to occur over HTTPS?
Got it fixed! I downloaded the image and included it with our website changing this line:
<img src="https://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
to this:
<img src="SLMedallion_ENU.png" alt="Get Microsoft Silverlight" style="border-style:none"/>
Apparently this link "https://go.microsoft.com/fwlink/?LinkId=161376" will still re-direct to a HTTP path to get the image. So downloading the image and including it directly fixed it.
In the page that is hosting your XAP file you will find the anchor tag with the URL to download the Silverlight runtime. You can either remove it or host a download on your own site under HTTPS.
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/xxx.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" value="true" />
<param name="windowless" value="true" />
<param name="AllowHtmlPopupWindow" value="true" />
<param name="EnableHtmlAccess" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
</div>
You can customize that whole anchor tag to pull content from your site.
You could change the HTTP to HTTPS links in the anchor file and that should solve the problem at hand.
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/xxx.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" value="true" />
<param name="windowless" value="true" />
<param name="AllowHtmlPopupWindow" value="true" />
<param name="EnableHtmlAccess" value="true" />
<a href="https://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="https://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
</div>
In my ASP.NET MVC application, I'm embedding Windows Media Player so that my users can listen to specific audio recordings. I'm using the following code:
<object width="100%" height="65" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
<param name="URL" value="/QualityAssurance/PlayRecording/<%: Model.CustomerOrder.Id.ToString() %>/<%: System.IO.Path.GetFileName(Model.RecordingFilename) %>" />
<param name="SendPlayStateChangeEvents" value="true" />
<param name="AutoStart" value="false" />
<param name="uiMode" value="mini" />
<param name="PlayCount" value="1" />
<param name="height" value="65px" />
<param name="width" value="100%" />
<param name="stretchtofit" value="true" />
<param name="showstatusbar" value="true" />
<param name="enablepositioncontrols" value="true" />
<param name="showpositioncontrols" value="true" />
<param name="enabletracker" value="true" />
<param name="showcontrols" value="true" />
<param name="showaudiocontrols" value="true" />
<param name="displaymode" value="true" />
<param name="enablecontextmenu" value="false" />
<param name="loop" value="false" />
<param name="windowslessVideo" value="true" />
</object>
I'm really happy with everything, works perfectly with the exception of one issue: the track bar doesn't work, so I cannot cue to a specific point in the audio. The only way to reach a specific point is to use the FF or FR buttons in WMP. If I click on the trackbar, it momentarily moves the thumbswitch to the desired point, but then just jumps back to the currently-playing position the moment I release the mouse button.
I'm sure it's just something simple I'm not doing but it's starting to get frustrating now. Any help/advice would be appreciated.
Thanks,
Simon.
EDIT:
I fixed the problem. For your benefit, here is the code:
<object id="VIDEO" width="100%" height="65" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
<param name="URL" value="/QualityAssurance/PlayRecording/<%: Model.CustomerOrder.Id.ToString() %>/<%: System.IO.Path.GetFileName(Model.RecordingFilename) %>">
<param name="SendPlayStateChangeEvents" value="true">
<param name="AutoStart" value="false">
<param name="PlayCount" value="1">
<param name="stretchtofit" value="true">
<param name="showstatusbar" value="true">
<param name="enablepositioncontrols" value="true">
<param name="showpositioncontrols" value="true">
<param name="enabletracker" value="true">
<param name="showcontrols" value="true">
<param name="showaudiocontrols" value="true">
<param name="enablecontextmenu" value="true">
</object>
Don't ask me why, but that combination of params works perfectly. The tracking bar doesn't work for the first few seconds, but after the file has streamed across and been buffered, it works perfectly.
Simon.
I fixed the problem. For your benefit, here is the code:
<object id="VIDEO" width="100%" height="65" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
<param name="URL" value="/QualityAssurance/PlayRecording/<%: Model.CustomerOrder.Id.ToString() %>/<%: System.IO.Path.GetFileName(Model.RecordingFilename) %>">
<param name="SendPlayStateChangeEvents" value="true">
<param name="AutoStart" value="false">
<param name="PlayCount" value="1">
<param name="stretchtofit" value="true">
<param name="showstatusbar" value="true">
<param name="enablepositioncontrols" value="true">
<param name="showpositioncontrols" value="true">
<param name="enabletracker" value="true">
<param name="showcontrols" value="true">
<param name="showaudiocontrols" value="true">
<param name="enablecontextmenu" value="true">
</object>
Don't ask me why, but that combination of params works perfectly. The tracking bar doesn't work for the first few seconds, but after the file has streamed across and been buffered, it works perfectly.
Simon.
when i am trying to show the HTML content in silverlight using the HtmlHost control it shows me the warning popup.
"The HtmlHost control should always be used with a windowless plugin. It cannot work reliably if this property is not specified"
How i can hide this warning popup
please help,thanks in advance.
Well, judging by the message you get, I would suggest setting the windowless mode property of your silverlight object to true.
Go to the html or aspx page where the silverlight object is created and add the property:
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/YourApplication.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50401.0" />
<param name="autoUpgrade" value="true" />
<param name="windowless" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
add the
<param name="windowless" value="true" />
to the 'yourprojectnameTestPage.html' and add
Silverlight.CreateObject(,,,{windowless:'bool'});
to silverlight.js
this two solves my problem cheers :) :)
Here is my code
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="70%" height="70%">
<param name="source" value="Video/SmoothStreamingPlayer.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50401.0" />
<param name="autoUpgrade" value="true" />
<param name="InitParams" value="selectedcaptionstream=textstream_eng,mediaurl=http://servername/Video/video.ssm/manifest" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object>
</div>
Question:
Is it possible to have mediaurl attribute set to a relative path?
So instead of
http://servername/Video/video.ssm/manifest
It would be something like
/Video/video.ssm/manifest
I tried it as is, but it errored out.
Thanks!
No, the media must be served directly via IIS
I have a textbox that when you put focus into it, it drops down some values. Next to the textbox is a silverlight control, a canvas. The problem is that part of the dropdown displays behind the silverlight control. Is there a property I can set on one of the elements so it is diplayed on top of the silveright control?
I had this same problem with hover hints and dropdown lists as well. Try setting the windowless property of the silverlight control to true.
Eg:
<object id="yourSilverlightControl" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="500">
<param name="source" value="../ClientBin/yourSilverlightControl.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<param name="windowless" value="true" />
</object>