4

I have not found an answer to this, not here or when I have googled for it.

The case is that we have a silverlight with a video-stream. If we have enabled fullscreen with the code : Application.Current.Host.Content.IsFullScreen first time the application is taken to fullscreen it opens in the background (and for the customer it seems like nothing happens).

It seems it will remember it to the next time.

The alternative for our sake is to not enable it to disable this so that when the window loses focus it is taken out of fullscreen.

Is there a way to get around this, as we would both like to open it in fullscreen on top of the screen (not hidden), and have the possibility to make it pinned there. (Since many of our users would like to have it on another monitor and use the computer at the same time)

I have been thinking about storing it in application storage, as it seems it rememebers the first time a user move it in front. But dont know how this can be done, and also seems a bit hackish.

In IE this works, but of course this is not good enough.

Nitro
  • 624
  • 8
  • 21
  • 1
    Why not run as an out-of-browser application? Works like charm for me. Make sure that you check the "Require elevated trust" when running outside the browser – Dudemeister Apr 02 '12 at 13:12
  • Will give it a try. One reason that I can come up with is that this feature is the only thing I need for getting it work, so adding more than needed. Not sure exactly what the difference is for the user experience with out-of-browser application either. If its almost the same, then I think it will be a valid argument for going for it, but would still like to fix the problem rather than avoid it. – Nitro Apr 03 '12 at 11:05
  • @Dudemeister why the elevated trust? It shouldn't be required for this scenario. – jv42 Apr 04 '12 at 13:13
  • There are keyboard input limitations when running in fullscreen and not in elevated-trust: http://msdn.microsoft.com/en-us/library/cc189015%28v=vs.95%29.aspx – Dudemeister Apr 04 '12 at 13:29
  • @Dudemeister ah, it makes sense then :) – jv42 Apr 12 '12 at 09:12

1 Answers1

2

To have your application stay fullscreen even when not focused, you have to add the following to your Application:

Host.Content.FullScreenOptions = System.Windows.Interop.FullScreenOptions.StaysFullScreenWhenUnfocused;

This will generate a prompt for permission when you switch to full screen mode, similar to IsolatedStorage quota prompts.

For the app showing in background, I only have experienced this using Safari on MacOS, I never had this issue on Windows IE, FF or Chrome. Maybe the line above will help matters though.

jv42
  • 8,521
  • 5
  • 40
  • 64
  • This solves the first part of getting it to stay focused. But unfortunlately its the second part that is bogging me the most. And is the reason why we have to chose between loosing focus (which is the minor usergroup), and the ones having the fullscreen going into the background. Problem occurs in both, FF, Chrome, Safari on MacOS. I guess the solution for my part would be to include a toggle button that lets the users decide. – Nitro Apr 04 '12 at 09:56
  • Maybe I've misunderstood the structure of your app. Do you have a single window with your content, including video, or do you have a ChildWindow or something like that? – jv42 Apr 04 '12 at 13:14
  • I have a single silverlight window with just the SMF-based player. I have also experienced the same problem with other streaming solution. With the problem of the window appearing in background. (Which in our case would confuse more users than the benefit of having it this way) Will try to upload a version, so that it could be seen in action. – Nitro Apr 11 '12 at 19:54
  • Ok, I've got no issues like that with a SMF-based player myself, except on MacOS+Safari. – jv42 Apr 12 '12 at 08:21
  • This only happens the first time, so if I clean the application storage (or disable it), it will happen every time. Will come back when I had the time to look more into it. – Nitro Apr 12 '12 at 08:46