Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube Fullscreen not working #11

Open
realandrewjose opened this issue Feb 8, 2018 · 10 comments
Open

YouTube Fullscreen not working #11

realandrewjose opened this issue Feb 8, 2018 · 10 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@realandrewjose
Copy link
Member

Needs immediate developer attention. The full screen only covers the area of the component - not the screen

@realandrewjose realandrewjose added the bug Something isn't working label Feb 8, 2018
@realandrewjose realandrewjose self-assigned this Feb 8, 2018
@novastream
Copy link
Collaborator

Try implementing a custom DisplayHandler. Here's mine, if you need help with anything please let me know.

`public sealed class PlayerDisplayHandler : IDisplayHandler
{
private Control parent;
private Form fullScreenForm;

    void IDisplayHandler.OnAddressChanged(IWebBrowser browserControl, AddressChangedEventArgs addressChangedArgs)
    {
        // ignore
    }

    bool IDisplayHandler.OnConsoleMessage(IWebBrowser browserControl, ConsoleMessageEventArgs consoleMessageArgs)
    {
        return false;
    }

    void IDisplayHandler.OnFaviconUrlChange(IWebBrowser browserControl, IBrowser browser, IList<string> urls)
    {
        // ignore
    }

    void IDisplayHandler.OnFullscreenModeChange(IWebBrowser browserControl, IBrowser browser, bool fullscreen)
    {
        // Get the Chromium control
        ChromiumWebBrowser chromiumWebBrowser = (ChromiumWebBrowser)browserControl;

        // Invoke the UI thread if needed
        chromiumWebBrowser.InvokeOnUiThreadIfRequired(() =>
        {
            // If fullscreen is set to true
            if (fullscreen)
            {
                // Remove the chromium browser from the parent form
                parent = chromiumWebBrowser.Parent;
                parent.Controls.Remove(chromiumWebBrowser);

                // Create fullscreen borderless form
                fullScreenForm = new Form()
                {
                    FormBorderStyle = FormBorderStyle.None,
                    WindowState = FormWindowState.Maximized,
                    StartPosition = FormStartPosition.CenterParent,
                    Icon = Properties.Resources.icon,
                    TopMost = false,
                    ShowInTaskbar = false                        
                };

                // Suspend layout on resize begin
                fullScreenForm.ResizeBegin += (s, e) =>
                {
                    fullScreenForm.SuspendLayout();
                };

                // Resume layout on resize end
                fullScreenForm.ResizeEnd += (s, e) =>
                {
                    fullScreenForm.ResumeLayout(true);
                };

                // Add the chromium browser to the fullscreen form
                fullScreenForm.Controls.Add(chromiumWebBrowser);
                fullScreenForm.ShowDialog(parent.FindForm());
            }
            else
            {
                fullScreenForm.Controls.Remove(chromiumWebBrowser);

                parent.Controls.Add(chromiumWebBrowser);

                fullScreenForm.Close();
                fullScreenForm.Dispose();
                fullScreenForm = null;
            }
        });
    }

    void IDisplayHandler.OnStatusMessage(IWebBrowser browserControl, StatusMessageEventArgs statusMessageArgs)
    {
        // ignore
    }

    void IDisplayHandler.OnTitleChanged(IWebBrowser browserControl, TitleChangedEventArgs titleChangedArgs)
    {
        // ignore
    }

    bool IDisplayHandler.OnTooltipChanged(IWebBrowser browserControl, string text)
    {
        return false;
    }
}`

@realandrewjose
Copy link
Member Author

Hi, novastream, can you add it and make a pull request. By doing this you will be really making a helpful contribution, and will be considered part of 'FlameSky Contributors' - the developer of FlameSky.

@realandrewjose
Copy link
Member Author

And your contribution will be logged.

@realandrewjose
Copy link
Member Author

We always credit the contributors who help contribute to FlameSky. In fact the contributors (https://github.com/flameskyofficial/FlameSky/graphs/contributors) are considered the main developers.

@realandrewjose realandrewjose added the help wanted Extra attention is needed label Feb 25, 2018
@realandrewjose
Copy link
Member Author

Any volunteers, please help fix this issue. We need you for a successful webrowser

@realandrewjose
Copy link
Member Author

@novastream Can you fix this, please and make a pull request?

@novastream
Copy link
Collaborator

Sure, just need to do a couple of work related things before I can create a pull request. I'll get back to you.

@realandrewjose
Copy link
Member Author

Thanks @novastream !

@realandrewjose
Copy link
Member Author

Thanks to @novastream , a major issue in FlameSky has been resolved. Now users can view videos in fullscreen!!!!!

@jarno9981
Copy link

Update the cefsharp browser nuget than it will work version 83.01.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants