mono / gtk-sharp

Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit and the foundation of most GUI apps built with Mono
http://www.mono-project.com/GtkSharp
Other
424 stars 140 forks source link

GTK play VLC video, only sound, no image #301

Open bbhxwl opened 3 years ago

bbhxwl commented 3 years ago

net core 3.1 ` static void Main(string[] args) {

        Core.Initialize();

        // Initializes the GTK# app
        Application.Init();

        using var libvlc = new LibVLC(enableDebugLogs: true);
        using var mediaPlayer = new MediaPlayer(libvlc);
        // Create the window in code. This could be done in glade as well, I guess...
        var myWin = new Window("LibVLCSharp.GTK.Sample");
        myWin.Resize(800, 450);
        Frame c = new Frame();

        mediaPlayer.Hwnd = c.Handle;
        myWin.Add(c);
        myWin.ShowAll();
        using var media = new Media(libvlc,
            new Uri("https://bj.bcebos.com/kpy-organizations/U2943159/videos/2021062612303528372289135202.mp4"));
        mediaPlayer.Play(media);
        myWin.DeleteEvent += (sender, args) =>
        {
            mediaPlayer.Stop();
            Application.Quit();
        };

        Application.Run();

    }

`

image

mfkl commented 3 years ago

How about you stop spamming?