Silverlight 3 localization configuration - silverlight-3.0

I would like to know how I can configure my Silverlight application to be able to change the UICulture of the current thread without having to recompile the application.
If I set the current thread culture in the app.xaml, I need to recompile each time to change the culture. If I add an Application Settings, how can I retrieve that information on the client to be able to change the current thread culture info?
any ideas ?

You can the culture from your html or aspx file that hosts the silverlight application. This would not require a recompile of your application but would require a refresh of the web page. This approach is dependent on the Culture Names list. Hope this helps.
Ex:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SL_Loc_Sample2.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="culture" value="de" />
<param name="uiculture" value="de" />
<!--<param name="culture" value="fr" />
<param name="uiculture" value="fr" />-->
<!--<param name="culture" value="ja" />
<param name="uiculture" value="ja" />-->
<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>

Related

flash object not displaying in safari

I have a flash object embedded in my website with the embed code that I got from a website. It does not show up in Safari, it's just a blank area where the flash object is supposed to be. What can I do to get the object to show up in Safari? Thanks.
Here is the embedded code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" height="250" width="258" id="sn_player" align="middle">
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="transparent" />
<param name="allownetworking" value="all" />
<param name="bgcolor" value="#000000" />
<param name="movie" value="http://sermonplayer.com/swf/player45.swf">
<PARAM name="flashvars" value="file=http://sermonplayer.com/build_xml_wzd_sn.php?player=12031-recent-.xml&skin=http://sermonplayer.com/swf/modieus_arial_ond.swf&backcolor=#111111&frontcolor=#2ea0aa&lightcolor=#2ea0aa&=Save&player_name=name (no punctuation)&controlbar=bottom&autostart=false&displayclick=play&icons=true&mute=false&repeat=none&shuffle=false&stretching=fill&plugins=&viral.onpause=false" />
<embed src="http://sermonplayer.com/swf/player45.swf" quality="high" height="250" width="260" id="sn_player" align="middle" allowScriptAccess="always" allowfullscreen="true" bgcolor="#000000" wmode="opaque" type="application/x-shockwave-flash" flashvars="file=http://sermonplayer.com/build_xml_wzd_sn.php?player=12031-recent-.xml&skin=http://sermonplayer.com/swf/modieus_arial_ond.swf&backcolor=#000000&frontcolor=#888888&lightcolor=#2ea0aa&=Save&player_name=name (no punctuation)&controlbar=bottom&autostart=false&displayclick=play&icons=true&mute=false&repeat=none&shuffle=false&stretching=fill&plugins=&viral.onpause=false" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed></object> <img src="http://www.sermonplayer.com/images/poweredby.gif" border="0" height="1px" width="1px">
I tested it in my safari browser in a clean rails app and it worked just fine. I'm using safari 5.2.1, also check to see if your flash player is updated to the latest version.

Combres js urls too long for Chrome Developer tools

Due to the url length for js resources on my local dev site, it's really annoying to try to find the script I'm looking for.
I'm using combres 2.2.2.4. Here's my relevant combres.xml section:
<jsMinifiers>
<minifier name="msajax" type="Combres.Minifiers.MSAjaxJSMinifier, Combres"
binderType="Combres.Binders.SimpleObjectBinder, Combres">
<param name="CollapseToLiteral" type="bool" value="true" />
<param name="EvalsAreSafe" type="bool" value="true" />
<param name="MacSafariQuirks" type="bool" value="true" />
<param name="CatchAsLocal" type="bool" value="true" />
<param name="LocalRenaming" type="string" value="KeepAll" />
<param name="OutputMode" type="string" value="SingleLine" />
<param name="RemoveUnneededCode" type="bool" value="true" />
<param name="StripDebugStatements" type="bool" value="true" />
</minifier>
<minifier name="yui" type="Combres.Minifiers.YuiJSMinifier, Combres">
<param name="IsVerboseLogging" type="bool" value="false" />
<param name="IsObfuscateJavascript" type="bool" value="true" />
<param name="PreserveAllSemicolons" type="bool" value="false" />
<param name="DisableOptimizations" type="bool" value="false" />
<param name="LineBreakPosition" type="int" value="80" />
</minifier>
</jsMinifiers>
<resourceSets url="~/combres.axd" defaultDuration="30"
defaultVersion="auto"
defaultIgnorePipelineWhenDebug="true"
defaultDebugEnabled="true"
defaultJSMinifierRef="msajax"
defaultCssMinifierRef="yui"
defaultCompressionEnabled="true" >
Any thoughts?
Updates:
I'm still not sure where those hash numbers are coming from. I've jiggled the defaultVersion, defaultVersionGenerator, and version tags of the resources, but I can't seem to see a change.
I've just turned debug off, and I notice that in chrome, it shows
/scripts
/1
indicating that when debug is turned off, the defaultVersion works just as documented, but with debug on, the huge hashes are back. I'm looking into whether it's the version of Combres (we recently updated).
Well, rolled back to 2.1.0.0, and I found the same behavior. It actually might not be Combres here, even though it looks like it should be. I'll continue hunting.
Looks Combres is configured to uses Sha512VersionGenerator (it doesn't show in your config segment, so I suppose that is set in other segments). Try either set versionGenerator of resourceSet (or defaultVersionGenerator of resourceSets, and remember to remove versionGenerator in resourceSet) to:
Combres.VersionGenerators.HashCodeVersionGenerator
Remove the versionGenerator attribute and manually set its version
Proposed by Buu Nguyen:
In Debug mode, the hash generation cannot be "turned off" via Combres configuration. However, it may be possible to modify GetResourceUrl to remove the hash from the Url.

How to keep brightcove player in the app and not jumping to safari

I have a PhoneGap application I am developing for iPad that uses video extensively, all of which is hosted at Brightcove. The Brightcove player code works fine when testing as a WebApp, but once compiled with PhoneGap in Xcode, the page containing the player immediately jumps out of the app and opens Safari to display the player.
I have added the appropriate domains to the ExternalHosts array, such that I am not getting any build errors mentioning whitelist problems.
Any ideas how to keep that from happening? I just want the player to load up into the app view it is located in. thx
Here's the standard Brightcove player code embedded in the page:
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperienceXXXXXXXXXXXXXXXXXXX" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="480" />
<param name="height" value="450" />
<param name="playerID" value="1149493366001" />
<param name="playerKey" value="XXXXXXXXXXXXXXXXXXXXXXXX" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="#videoPlayer" value="XXXXXXXXXXXX" />
</object>
This issue was a confirmed bug and has been resolved in PhoneGap 1.2.0

whats the best way to include silverlight pages into an asp.net-mvc site

i have an asp.net-mvc website and i want to merge in some functionality from a silverlight app. i could rewrite but for the time being i wanted to see if there is any clean way to "include" a few silverlight pages inside my mvc app.
what is the recommended way of doing this ?
The New Silverlight Application Wizard allows you to choose ASP.NET MVC as host application and it will setup the necessary parts:
All that you need is to embed the Silverlight application in any view:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SomeSlApp.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" 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 could also write a HTML helper allowing you to achieve this in a cleaner way.

Can I use the silverlight server control inside an asp.net mvc 2 page?

I can't find it when typing
<asp:
With MVC you don't use webform controls. <asp:...> are tags used by webform controls. Silverlight doesn't require a webform control to work anyways, you just need to add the following HTML to your view:
<object id="objYourSilverlightControl" data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" width="500px" height="500px">
<param name="source" value="../ClientBin/youSilverlightControl.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" />
<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>
I think the webform control that you are referring is no longer supported anyways (it might be still but I have never needed to use it).

Resources