Open realandrewjose opened 6 years ago
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;
}
}`
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.
And your contribution will be logged.
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.
Any volunteers, please help fix this issue. We need you for a successful webrowser
@novastream Can you fix this, please and make a pull request?
Sure, just need to do a couple of work related things before I can create a pull request. I'll get back to you.
Thanks @novastream !
Thanks to @novastream , a major issue in FlameSky has been resolved. Now users can view videos in fullscreen!!!!!
Update the cefsharp browser nuget than it will work version 83.01.1
Needs immediate developer attention. The full screen only covers the area of the component - not the screen