Şu kodlarında webview2 kullanmak yerine LibVlcSharp kütüphanesi ile her kanala özel…
- User
Şu kodlarında webview2 kullanmak yerine LibVlcSharp kütüphanesi ile her kanala özel tanımaldığımız m3u8 linklerini açsın <ui:FluentWindow x:Class=“KolayTV.MainWindow” xmlns=“http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=“http://schemas.microsoft.com/winfx/2006/xaml” xmlns:ui=“http://schemas.lepo.co/wpfui/2022/xaml” xmlns:d=“http://schemas.microsoft.com/expression/blend/2008” xmlns:mc=“http://schemas.openxmlformats.org/markup-compatibility/2006” xmlns:wv2=“clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf” xmlns:local=“clr-namespace:KolayTV” mc:Ignorable=“d” WindowStartupLocation=“CenterScreen” ExtendsContentIntoTitleBar=“True” WindowBackdropType=“Mica” WindowCornerPreference=“Round” Title=“KolayTV” Height=“450” MinWidth=“800”> <ui:TitleBar Title=“KolayTV” CanMaximize=“True”/> <ui:TextBox Background=“Transparent” PlaceholderText=“Kanal ara…” Width=“170” Margin=“0,50,0,5”/> <ListViewItem Content=“TRT 1”/> <ListViewItem Content=“TRT 2”/> <wv2:WebView2 x:Name=“webView” Source=“about:blank” Margin=“0,30,0,30”/> </ui:FluentWindow> using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Resources; using System.Windows.Shapes; using Wpf.Ui.Controls;
namespace KolayTV { /// /// MainWindow.xaml etkileşim mantığı /// public partial class MainWindow : FluentWindow { public MainWindow() { InitializeComponent(); } private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Seçilen öğeyi al var listView = (ListView)sender; var selectedChannel = (ListViewItem)listView.SelectedItem;
// Seçilen kanalın adını al var channelName = (string)selectedChannel.Content;
// HTML dosyasının yolunu oluştur var htmlFilePath = $“pack://application:,/Kanallar/{channelName}.html”;
// Dosya yolunu Uri’ye çevir var fileUri = new Uri(htmlFilePath);
// Kaynak dosyayı StreamResourceInfo olarak yükle StreamResourceInfo streamInfo = Application.GetResourceStream(fileUri);
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.