Note that there are some explanatory texts on larger screens.

plurals
  1. POGet the silverlight player into fullscreen mode from outside the silverlight code
    text
    copied!<p>I have a silverlight mediaElement embeded in my asp.net page as follow: </p> <pre><code>&lt;object id="SilverlightPlayer" data="data:application/x-silverlight," type="application/x-silverlight-2" width="753" height="468" &gt; &lt;param name="source" value="ClientBin/VideoPlayer.xap"/&gt; &lt;param name="EnableGPUAcceleration" value="true" /&gt; &lt;param name="OnResize" value="HandleResize" /&gt; &lt;param name="autoUpgrade" value="true" /&gt; &lt;param name="onLoad" value="pluginLoaded" /&gt; &lt;param name="windowless" value="true" /&gt; &lt;param name="background" value="transparent" /&gt; &lt;param name="initParams" id="SLInitParameters" /&gt; &lt;/object&gt; </code></pre> <p>I am implementing all the player controls from the asp.net side and invoking the SL methods using the javascript bridge. Everything works fine except the ability to put the silverlight player in full screen mode. <code>content.IsFullScreen = True;</code></p> <p>I have tried calling a method from javascript:</p> <pre><code>[ScriptableMember] public void mediaFullScreen() { var content = Application.Current.Host.Content; content.IsFullScreen = !content.IsFullScreen; } </code></pre> <p>I put a button in the Silverlight code which works fine. So, I had the javascript call a the function above. I then changed the code invoke the click event on the SL full screen button, however, that does not work either:</p> <pre><code>ButtonAutomationPeer peer = new ButtonAutomationPeer((Button)this.fullScreenButton); IInvokeProvider ip = (IInvokeProvider)peer; ip.Invoke(); </code></pre> <p>I even wired up an event handler in the SL code to process the click event on the tag:</p> <pre><code>HtmlDocument htmlDoc = HtmlPage.Document; HtmlElement htmlEle = htmlDoc.GetElementById("buttonFullScreen"); htmlEle.AttachEvent("onclick", new EventHandler(this.OnConvertClicked)); </code></pre> <p>Is there anyway I can get the SL to go into full screen mode from my tag in the asp.net code? (Using VS2010 and SL4)</p> <p>Thanks, Dave</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload