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

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

@bbhxwl

Description

@bbhxwl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions