Jump to content

start fullscreen on Chrome and Windows


irigsoft

Recommended Posts

Hi there.

We use this code

 

"var docElm = document.documentElement;

if (docElm.requestFullscreen) {

    docElm.requestFullscreen();

}

else if (docElm.mozRequestFullScreen) {

    docElm.mozRequestFullScreen();

}

else if (docElm.webkitRequestFullScreen) {

    docElm.webkitRequestFullScreen();

}

else if (docElm.msRequestFullscreen) {

    docElm.msRequestFullscreen();

}"

 

for starting Browser Full Screen, try with diferent ways:


 

UniSession.JSCode (Data);

OR

UniSession.AddJs (Data);

OR

UniSession.JSONDirect (Data);


 

but browser not going on Fullscreen.

 

What I am wrong?

Link to comment
Share on other sites

Thanks.

I know that.

 

I have a desktop application with user interface design, in this application enable users to create their own functions.

 

Now, I will use unigui to create Web server applications with the designed form and functions.

All functions are in text files so this web server will use

UniSession.JSCode (Data);

OR

UniSession.AddJs (Data);

OR

UniSession.JSONDirect (Data), to complete them.

 

it all starts with Button Click event.

 

With an older version (I think 98) this example works fine, but with last version 99.1346 not work.

Link to comment
Share on other sites

Hi,

 

For now can you try this?!:

 

1. MainForm -> Script:

function launchIntoFullscreen(element) {
    if (element.requestFullscreen) {
        element.requestFullscreen();
    } else if (element.mozRequestFullScreen) {
        element.mozRequestFullScreen();
    } else if (element.webkitRequestFullscreen) {
        element.webkitRequestFullscreen();
    } else if (element.msRequestFullscreen) {
        element.msRequestFullscreen();
    }
}

function exitFullscreen() {
    if (document.exitFullscreen) {
        document.exitFullscreen();
    } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
    } else if (document.webkitExitFullscreen) {
        document.webkitExitFullscreen();
    }
}

2. For fullscreen Button -> ClientEvents -> ExtEvents -> function click:

function click(sender, e, eOpts)
{
    launchIntoFullscreen(document.documentElement);
}

3. For exit fullscreen Button -> ClientEvents -> ExtEvents -> function click:

function click(sender, e, eOpts)
{
    exitFullscreen();
}

Best regards.

Link to comment
Share on other sites

I would like to know is it possible can use the some of the above - mentioned methods to perform functions of the file. I started with tests rudimentary attempt fullscreen, but it did not work. Then I tried to use a similar method to let sound, but it did not work.

I would like to note that I use the same script that worked on the old version.

 

So I wonder if this is a bug in the version or another cause.

Thanks.

Link to comment
Share on other sites

Thanks.

I use windows XP, Chrome Version 49.0.2623.112 m

Start server, Create Main Form, after that  I create other Application Form.

On second form I create at run time different components, some have java script functions (this functions server read from "server path\files\JavascriptFileName.txt")

 

When I click on some component must execute UniSession.JSCode (Data); Data = readed from file functions.

 

On this scenario I can't execute javascript function Fullscreen.

 

I try 

Delphi Developer's 

example on My smartphone Android 5.5

on my Tablet

on My Windows XP Chrome browser

on My Company Windows 7 Chrome broswer, 

server is running on Windows Xp, but "fullscreen" is not working.

when I use F11, my Chrome go to "Fullscreen"

Link to comment
Share on other sites

Hi,

 

Sorry, If you asking a question, and if I understand you correctly, then you can use this:

procedure TYourNewForm.UniFormCreate(Sender: TObject);
...
begin
  ...
  NewUniButton.Name := 'NewName';
  NewUniButton.ClientEvents.ExtEvents.Values['click'] := 'function click(sender, e, eOpts){yourJSFunction();}';
  ...
Link to comment
Share on other sites

I try this with in

Button.OnClick ();

begin

UniSession.JSCode ('

function launchIntoFullscreen(element) {

alert (element.name); //here I expect button.name or some, but I get "undefined"
if (element.requestFullscreen) {
       element.requestFullscreen();
   } else if (element.mozRequestFullScreen) {
       element.mozRequestFullScreen();
   } else if (element.webkitRequestFullscreen) {
       element.webkitRequestFullscreen();
   } else if (element.msRequestFullscreen) {
       element.msRequestFullscreen();
   }
};
 

launchIntoFullscreen (document.documentElement);');

end;

 

anybody can tell me why (new'm javascript) ?

Link to comment
Share on other sites

  • Administrators

Or may be not with this support ?

 

Hi,

 

Or support does not cover solving browser specific technologies and/or custom JS code which you send to the client to perform a specific task which again can be browser specific.

That said, we do our best to help our customers in such cases. Since you are trying uniGUI since version 0.98, I think it is right time to switch to our commercial edition soon! :)

 

Thank you

 

PS: you can attach a test case for us to see what exactly is the problem. (or send it to info@fmsoft.net)

Link to comment
Share on other sites

I install last version.

I make my own server application and I want to know what can  or can not to do  with unigui.

 

When I use unigui for the first time I try this option with JScode, AddJs and so on and all work fine.

After that I install version 99.1309 and Fullscreen stop working, then install 1364 and no change.

 

For that reason I want to know what is changed between this 3 versions.

Logic on my server is: enabled user to can make own javascript function and add to application without changing programming code like *.js functions on other web servers.

 

I try some functions like, play sound, start video, go to Full screen, url redirect , always with AddJs and data readed from text files.

Everiting work fine on my first installed version on unigui, after upgrade for first time I lost all working functions.

 

Change only unigui, not changed Chrome, not changed Windows XP or anything else

 

Please help.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...