Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

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

Open
bbhxwl opened this issue Jun 26, 2021 · 1 comment
Open

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

bbhxwl opened this issue Jun 26, 2021 · 1 comment

Comments

@bbhxwl
Copy link

bbhxwl commented Jun 26, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants