Comments (12)
Hi, a simple workaround would be to set your window state to none and hide everything once in full screen mode. But that doesn't seem right to me.
from vlc.dotnet.
I'm trying to implement it adding the functions to Vlc.DotNet.Core.Interops and relative property into Vlc.DotNet.Core.VideoManagement :)
I will let you know if I succeed :)
from vlc.dotnet.
OK. It can be done this way (if zeBobo5 merges it in the code it needs a bit of clean up but it works perfectly)
in vlcControl.cs I added:
public void GoFullScreen()
{
var S = Screen.FromHandle(Handle); //to find the screen the control in on
var fi = S.GetType().GetField("hmonitor", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
IntPtr screenhandle = (IntPtr)fi.GetValue(S); //to get the screen handle
myVlcMediaPlayer.VideoHostControlHandle = screenhandle; //set video as NOT embedded (or full screen doesn't work)
myVlcMediaPlayer.Video.FullScreen = true; //added property.
}
in IVideoManagement.cs I added:
bool FullScreen { set; } //could have get too if needed.
in VideoManagement.cs I added:
public bool FullScreen
{
set
{
myManager.SetFullScreen(myMediaPlayer, value); //set full screen mode
}
}
Added file \Vlc.DotNet.Core.Interops\VlcManager.SetFullScreen.cs containing:
using System;
using Vlc.DotNet.Core.Interops.Signatures;
namespace Vlc.DotNet.Core.Interops
{
public sealed partial class VlcManager
{
public void SetFullScreen(VlcMediaPlayerInstance mediaPlayerInstance, bool fullScreen)
{
if (mediaPlayerInstance == IntPtr.Zero)
throw new ArgumentException("Media player instance is not initialized.");
GetInteropDelegate<SetFullScreen>().Invoke(mediaPlayerInstance, fullScreen ? 1 : 0);
}
}
}
Added file \Vlc.DotNet.Core.Interops\Signatures\libvlc_media_player.h\libvlc_set_fullscreen.cs containing:
using System;
using System.Runtime.InteropServices;
namespace Vlc.DotNet.Core.Interops.Signatures
{
/// <summary>
/// Set fullscreen.
/// </summary>
[LibVlcFunction("libvlc_set_fullscreen")]
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetFullScreen(IntPtr mediaPlayerInstance, int value);
}
and that's it.
How to use it:
open sample.
add a "Fullscreen" button.
on button click event handler just call
myVlcControl.GoFullScreen();
HOPE THIS WILL HELP SOMEONE 👍 :)
from vlc.dotnet.
Nice work! How about a "revert to normal mode"? Maybe implement a property "IsFullScreen" ...
from vlc.dotnet.
yeah sepehr1014, that was just a very quick (1 hour) and dirty (but proper) fix for the problem.
A lot of work can be done to polish it, for example you could add
public void RevertToWindow()
{
myVlcMediaPlayer.Video.FullScreen = false;
myVlcMediaPlayer.VideoHostControlHandle = Handle; //set video as embedded into control hwnd again
}
or implement, in the same way, the support for libvlc_get_fullscreen
(to provide a getter for public bool FullScreen
) and libvlc_toggle_fullscreen
....imagination is up to you :)
from vlc.dotnet.
Did this get merged?
from vlc.dotnet.
@LinoBarreca do not work~
from vlc.dotnet.
@ZeBobo5 - it looks like the code that @LinoBarreca wrote above to add a fullscreen option to Vlc.DotNet was never submitted as a pull request (and then the issue was closed and forgotten).
Are either of you able to get this into the codebase, or do you want some help putting it into a PR?
from vlc.dotnet.
@jeremyVignelles Hi, did this ever get into the code base?
from vlc.dotnet.
Hi, never heard of it in Vlc.DotNet, so I guess not. is that something you want to be merged? what would be the difference with setting your own window as fullscreen.
PR are welcome, but be careful, the warning in the documentation says that the child window needs to be reparented.
from vlc.dotnet.
fullscreen() in winform does not work
from vlc.dotnet.
As said here, the binding for the libvlc fullscreen function was added, but it needs reparenting the window, and it's not easy to work with. why not putting your WinForms control in fullscreen as you would normally do instead?
from vlc.dotnet.
Related Issues (20)
- scaletempo_pitch filter not working HOT 1
- how to split or cut a video? HOT 1
- "Direct Show Device Fails to Open" If it Contains a Failed Device in a List of Capture Devices HOT 14
- How to use LibVLCSharp make a Video Provider like VlcVideoSourceProvider.cs !! HOT 1
- How to install the Vlc.DotNet.Wpf.to a WPF .Net Framework using VB HOT 1
- two player play at the same time HOT 6
- VlcControl.Dispose never ends after trying to open Blu-ray disk without licensing or after ejecting the disc HOT 1
- (re-edit)Can vlc.dotnet play RTP over TCP(RFC 4751) H.264 video stream? HOT 6
- Can't set VlcLibDirectory HOT 10
- I want to develop UI in raspberry pi. Is there any way? HOT 13
- TakeSnapShot with stream parameter? HOT 1
- How to support Chinese directories? HOT 2
- My program was frozen during the setmedia operation HOT 2
- Playing some videos on any platform will get stuck HOT 6
- How can I to get frame data? HOT 1
- Is it possible to start player for fixed time. Assume I want to satrt my player for 5 minutes. HOT 2
- Visualization custom modification HOT 2
- how to change the audioDevice ?i can't let the code effective
- Hiding the console log window is not work HOT 1
- How do i simply play a video and get past the barrage of error messages. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vlc.dotnet.