Skip to content

Can't xamarin.forms uwp and net core play video?

https://code.videolan.org/videolan/LibVLCSharp/-/blob/3.x/samples/LibVLCSharp.GTK.Sample/Program.cs Can't net core use GTK # + VLC to play video? net core no have VideoView Net core GTK # can't play video on raspberry pie.

Can't xamarin.forms uwp play the video? https://github.com/ZeBobo5/Vlc.DotNet/issues/694

app.cs

public App() { LibVLCSharpFormsRenderer.Init(); LibVLCSharp.Shared.Core.Initialize(); this.InitializeComponent(); this.Suspending += OnSuspending; }

MainPage.cs

using LibVLCSharp.Forms.Shared; using LibVLCSharp.Shared; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms;

namespace App3 { public partial class MainPage : ContentPage { LibVLC LibVLC; MediaPlayer MediaPlayer; public MainPage() {

        InitializeComponent();
        this.Appearing += MainPage_Appearing;
       


    }


    private void MainPage_Appearing(object sender, EventArgs e)
    {
        LibVLC = new LibVLC(enableDebugLogs: true);

        var media = new Media(LibVLC, new Uri("https://bj.bcebos.com/kpy-organizations/U4460574/videos/2021052812045239653257462221.mp4"));

        MediaPlayer = new MediaPlayer(media) { EnableHardwareDecoding = true };
        MediaPlayer.Play();


         vlc.MediaPlayer = MediaPlayer;
        bool b = MediaPlayer.Play();
    }
}

}

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information