apimall / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

[CEF3] New feature: Need to support fullscreen api #562

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Fullscreen API is widely used in Web applications. CEF3 also needs to support 
such API. Reference http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html 
for details.

Original issue reported on code.google.com by hongbo....@gmail.com on 31 Mar 2012 at 5:22

GoogleCodeExporter commented 9 years ago
Attached is a patch for this featus. Pls review.

The patch is to implement the interface of 
WebContentsDelegate::ToggleFullscreenModeForTab. 

Thanks.

Original comment by hongbo....@gmail.com on 31 Mar 2012 at 5:25

Attachments:

GoogleCodeExporter commented 9 years ago
This patch is only for Windows.

Original comment by hongbo....@gmail.com on 31 Mar 2012 at 5:42

GoogleCodeExporter commented 9 years ago
I don't think we should implement full-screen mode internal to CEF because the 
behavior may be framework- or application-dependent. For example, some 
frameworks or use cases may have special requirements for how a full-screen 
window is created and/or managed. It would be better to add a new callback and 
allow the client to implement.

The new API could be:

--- CefDisplayHandler ---

// Called to change a browser window to or from full-screen mode. Return true if
// full-screen mode was changed or false otherwise.
virtual bool OnFullscreenModeChange(CefRefPtr<CefBrowser> browser,
                                    bool fullscreen) {
  return false;
}

--- CefBrowser ---

// Returns true if the browser window is currently in full-screen mode.
virtual bool IsFullscreen();

The PlatformToggleFullscreenModeForTab code in your patch can be added to 
cefclient as a sample implementation. Also, please run the tools/check_style 
tool and fix any errors before posting a new patch.

Original comment by magreenb...@gmail.com on 2 Apr 2012 at 3:00

GoogleCodeExporter commented 9 years ago
Thanks. I will update it later.

Original comment by hongbo....@gmail.com on 6 Apr 2012 at 3:06

GoogleCodeExporter commented 9 years ago
Basically, I agree your point. However, after my further consideration, I think 
we can provide a default implementation in libcef, and meanwhile provide a 
client callback to allow application specific handling for fullscreen.

The default implementation only takes effect in case of "fullscreen-enabled" 
switch is turned on. 

If client wants to provide their own implementation for fullscreen api, they 
should disable fullscreen-enabled and implement the callback.

So in this way, client can leverage the default implementation at maximium 
without rewriting the fullscreen logic code. 

You opinion? Thanks

Original comment by hongbo....@gmail.com on 17 Apr 2012 at 6:24

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 18 Oct 2012 at 1:49

GoogleCodeExporter commented 9 years ago
I have integrated the code patch into CEF3, seems the video in web page was 
still not able to fullscreeen.

I have aslo tried Version 1.963.439 of CEF1 release on December 22, 2011, the 
added CefBrowserSettings.fullscreen_enabled flag has no effect to fullscreen 
the page.

Any advice ?

Original comment by ShenHui...@gmail.com on 22 Oct 2012 at 6:44

GoogleCodeExporter commented 9 years ago
Hello all,

We have done some modification in source code of chromium and found that the 
fullscreen_enabled flag worked. We'd like to share the modification in the 
below.

Target file:
\chromium\src\third_party\WebKit\Source\WebKit\chromium\src\WebViewImpl.cpp

Target functions modified:
void WebViewImpl::enterFullScreenForElement(WebCore::Element* element)
{
   willEnterFullScreen();
   didEnterFullScreen();
}

void WebViewImpl::exitFullScreenForElement(WebCore::Element* element)
{
    // The client is exiting full screen, so don't send a notification.
    if (m_isCancelingFullScreen)
        return;
    willExitFullScreen();
    didExitFullScreen();
}

I don't know whether any potential risks exist, so any advice will be much 
appreciated.

Original comment by ShenHui...@gmail.com on 24 Oct 2012 at 10:39

GoogleCodeExporter commented 9 years ago

After applying the above changes and clicking on "fullscreen" button on the 
video the tab gets full screened and not the video. Also the video remains the 
normal size.

Using Spy++ (from Visual Studio tools) I found that the hwnd is for the frame 
and the video element is part of the frame(hwnd). So increasing the size of the 
hwnd seems to be right.
So why is the video not getting resized and the tab is?

The change in patch is similar to the link given by  Czarek in:
http://magpcss.org/ceforum/viewtopic.php?p=14819
http://src.chromium.org/viewvc/chrome/trunk/src/ui/views/win/fullscreen_handler.
cc

Would there be any other approach?

I am using the trunk version of Cef3 and am at revision@170167 for chrome and 
revision@960 for cef3

Original comment by pradyum...@gmail.com on 24 Jan 2013 at 3:54

GoogleCodeExporter commented 9 years ago
I'm can't understand why someone needed for special handling in CEF for 
fullscreen API?
I'm making fullscreeen window for run CEF at fullscreen, while my application 
exactly work only in kiosks. Additional handling for F11 can be done by host 
application by resizing / placement window, ONLY WHEN IT NEEDED. Any other 
cases can be emulated by same way.
I'm doesn't disput about useful about this feature - but, really, anyone can 
explain, why this feature must be provided by CEF, instead of implemented by 
application?
Thanks!

PS: OnFullscreenModeChange? That is the shit? What my application can do useful 
on this event? Nothing, as for me.

Original comment by fdd...@gmail.com on 24 Jan 2013 at 10:13

GoogleCodeExporter commented 9 years ago
#comment#10: The HTML5 video player provides controls for entering full-screen 
mode, and there is also an existing JS API for controlling full-screen mode. 
The purpose of this change is to expose a callback so that the client 
application can implement this functionality when the button is pressed or the 
API is used.

Original comment by magreenb...@gmail.com on 25 Jan 2013 at 5:45

GoogleCodeExporter commented 9 years ago
Thanks, clear. I'm forgot about this.

Original comment by fdd...@gmail.com on 28 Jan 2013 at 10:24

GoogleCodeExporter commented 9 years ago
Issue 762 has been merged into this issue.

Original comment by magreenb...@gmail.com on 8 Mar 2013 at 9:58

GoogleCodeExporter commented 9 years ago
Is this issue resolved ? I can not find the method on DisplayHandler neither 
the settings on browser settings.

Original comment by tsing....@gmail.com on 9 Jan 2014 at 3:08

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 30 Jan 2014 at 1:06

GoogleCodeExporter commented 9 years ago
I've got fullscreen working for me in the chrome 29 and 33 cef branches. My 
patch is based on Hongbo's but it needed a few tweaks and I'm linux based so 
have entirely dropped the windows code. I've also included Marshal's callback 
suggestion, however I didn't get the refusal of fullscreen working. Also I've 
not done anything with the "fullscreen-enabled" mentioned above.

I've attached my patch against branch 1750 revision 1629. I've tested against 
32bit fedora 18, and the same patch also works against branch 1547 revision 
1491. I'm using cefpython so will also submit a cefpython patch to that project.

Prior to this patch IsFullscreenForTabOrPending always returned false, 
unfortunately this doesn't completely refuse fullscreen and the element can end 
up trying to fullscreen whilst leaving the rest of the dom unchanged.

I don't need to refuse fullscreen for my application so after some digging I 
left it TODO. What I found was that I could prevent fullscreen by hacking
third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp
I just commented out the calls to pushFullscreenElementStack, I don't think 
that's very useful but if anyone else needs to get it working that should 
provide a helpful staring point.

Original comment by finn.hug...@gmail.com on 28 Mar 2014 at 12:33

Attachments:

GoogleCodeExporter commented 9 years ago
I forgot to mention that I haven't included the autogenerated files as it adds 
a lot of noise, so after applying my patch you'll have to run ./translator.sh

Original comment by finn.hug...@gmail.com on 28 Mar 2014 at 12:35

GoogleCodeExporter commented 9 years ago
Hi guys, sorry if it is not the right place for that but can someone tell me if 
this fixes have something to do with a problem I have been facing when I need 
to go full screen inside of an iframe using CEF ? using allowfullscreen or 
webkitallowfullscreen hasn't helped
Thanks

Original comment by djonat...@gmail.com on 4 Jul 2014 at 3:28

GoogleCodeExporter commented 9 years ago
It seems likely, if you're asking the element to fullscreen and seeing it try 
but other elements in the dom not respond then my patch should help.

Original comment by finn.hug...@gmail.com on 4 Jul 2014 at 3:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Any idea how to implement this using X instead of GTK?

Original comment by megsmi...@gmail.com on 24 Nov 2014 at 10:55

GoogleCodeExporter commented 9 years ago
CEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/cef/issue/562

Original comment by magreenb...@gmail.com on 14 Mar 2015 at 3:22