locked
Exiting Video Full screen Mode programatically

    Question

  • Hi,

    I'm looking a way to exit video full screen mode  and tried with the following .

    document.getElementsByTagName('video')[0].msExitFullScreen()

    But this method throws an exception that this property is not supported. Is there any other way to do this.

    The scenario where I'm looking for is when there is no network connection, i want to show a prompt message to user and exit the full screen mode, so that  he could see the page directly.


    Thanks & Regards Tejaswi Chandrapatla

    Friday, January 03, 2014 1:35 PM

Answers

  • The msExitFullScreen() function is not available for Windows Store app. Perhaps a better idea of exiting from the video is to completely hide the <video> control by setting the media.style.visibility property to "hidden".

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Wednesday, January 08, 2014 1:46 AM
    Moderator

All replies

  • How is the video going to full screen mode to begin with? Maybe what you could do is to try sending a HTTP request to the URL you want to start playing - using Windows.Web.Http.HttpClient class. If you get back an error then do not show any Video element at all, but just show an error message to the user.

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Saturday, January 04, 2014 1:21 AM
    Moderator
  • we are setting the property -msfullscreen(exactly dont remember).

    While launching the video the way to find out you suggested is cool. But what if connection is lost in the middle?.


    Thanks & Regards Tejaswi Chandrapatla

    Sunday, January 05, 2014 4:49 PM
  • How are you displaying video to the user? Using the <video> tag ? Can you post a snippet of your HTML/JS code here?

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Tuesday, January 07, 2014 1:57 AM
    Moderator
  • Hi Prasanth,

    Here is the snippets how we are doing it.

    //Video tag in html page
     <video id="mediaVideo" msaudiocategory="BackgroundCapableMedia"  controls />
    
    
    
    //initating events and requesting full screen
    
      media = document.getElementById("mediaVideo");
     media.msRequestFullscreen();
     media.addEventListener("loadeddata", mediaLoaded, false);
     media.addEventListener("volumechange",mediaVolumeChanged, false);
    media.addEventListener("pause", mediaPaused, false);
    media.addEventListener("ended", mediaEnded, false);
    media.addEventListener("playing", mediaPlaying, false);
    media.addEventListener("stalled", mediaStalled, false);
    media.addEventListener("waiting", mediaWaiting, false);
    priory to this we are setting media.src=<<url of the video>>


    Thanks & Regards Tejaswi Chandrapatla

    Tuesday, January 07, 2014 4:44 AM
  • The msExitFullScreen() function is not available for Windows Store app. Perhaps a better idea of exiting from the video is to completely hide the <video> control by setting the media.style.visibility property to "hidden".

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Wednesday, January 08, 2014 1:46 AM
    Moderator