Cevaplar
-
Örnek kod eklerseniz yardımcı olabiliriz.
-
hilmisu
using System; using System.Collections.Generic; using System.Linq; using System.Text; 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.Shapes; using AxAXVLC; namespace subtitledVlc { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { AxVLCPlugin vlc; playlistForm pForm; DownloadManager.Form1 downloadFrm; System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog(); public MainWindow() { InitializeComponent(); pForm = new playlistForm(); downloadFrm = new DownloadManager.Form1(); vlc = new AxVLCPlugin(); windowsFormsHost1.Child = vlc; slider1.Minimum = 0; slider1.Maximum = 100; groupBox1.Header = "Volume " + slider1.Value.ToString("0.#") + "%"; pForm.Visible = false; downloadFrm.Visible = false; } private void openVideoClick(object sender, RoutedEventArgs e) { ofd.ShowDialog(); if (ofd.FileName != "") { pForm.playListItem.Add(ofd.FileName); pForm.fillPlayList(); for (int i = 0; i < pForm.playList().Count; i++) { vlc.addTarget(pForm.playList()[i].ToString(), null, AXVLC.VLCPlaylistMode.VLCPlayListAppend, 0); } vlc.play(); } } private void pauseVideoClick(object sender, RoutedEventArgs e) { if (vlc.Playing){vlc.pause();} else { vlc.play(); } } private void playVideoClick(object sender, RoutedEventArgs e) { try{ vlc.addTarget(pForm.playList()[0].ToString(), null, AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, 0); vlc.play(); } catch(Exception exc) { MessageBox.Show("There is nothing in the playlist"); } } private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { vlc.Volume = Convert.ToInt16(slider1.Value);// Convert.ToInt16(e.NewValue); groupBox1.Header = "Volume " + slider1.Value.ToString("0.#") + "%"; } private void playFasterForwardClick(object sender, RoutedEventArgs e) { try { vlc.stop(); vlc.addTarget(pForm.playList()[1].ToString(), null, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo, 1); vlc.Update(); vlc.play(); } catch (Exception exc) { MessageBox.Show("There is nothing in the playlist"); } } private void playFasterBackWardClick(object sender, RoutedEventArgs e) { vlc.playlistPrev(); vlc.play(); } private void playListButtonClick(object sender, RoutedEventArgs e) { pForm.Visible = true; } private void downloadSubtitleClick(object sender, RoutedEventArgs e) { downloadFrm.Visible = true; } private void videoLengthSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { videoLengthSlider.Maximum = vlc.Length; videoLengthSlider.Minimum = 0; vlc.shuttle(Convert.ToInt32(videoLengthSlider.Value)); } } }
12 yıl önce yazılmış
-