bonjour voici mon problème. sur la base de cet exempte trouvé sur le site vlc
j'essaye de créer un control vlc dans un form pour ce faire j'ai bien mis les deux dll dotnet.core.dll et dotnet.form.dll dans mes références et j'ai ajouter les trois using pour les espaces de noms
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public partial class VlcForm : Form { public VlcForm() { //Initialization of control Vlc.DotNet.Forms.VlcControl vlcControl = new Vlc.DotNet.Forms.VlcControl(); vlcControl.VlcLibPath = @"C:\Program Files\VideoLan\VLC\"; vlcControl.Dock = DockStyle.Fill; this.Controls.Add(vlcControl); //Create a media Vlc.DotNet.Core.Medias.FileMedia fileMedia = new Vlc.DotNet.Core.Medias.FileMedia(); fileMedia.FilePath = @"C:\Videos\Test.avi"; //Add this media to the medias library vlcControl.Manager.MediaLibrary.MediaItems.Add(fileMedia); //Set auto start vlcControl.Manager.AutoStart = true; } }
mon poblème est que lorsque je veux ajouter mon médiafile à la liste des médiaItems via un Add() j'ai une message me disant
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 using Vlc.DotNet.Core; using Vlc.DotNet.Forms; using Vlc.DotNet.Core.Medias;
je n'arrive pas à trouver mon erreur et je fais donc encore appel à vousErreur 1 'Vlc.DotNet.Core.VlcMediaCollection' ne contient pas une définition pour 'add' et aucune méthode d'extension 'add' acceptant un premier argument de type 'Vlc.DotNet.Core.VlcMediaCollection' n'a été trouvée (une directive using ou une référence d'assembly est-elle manquante ?) C:\Documents and Settings\Patricia\Mes documents\Visual Studio 2008\Projects\20090426_essai_vlc_form\20090426_essai_vlc_form\Form1.cs 36 53 20090426_essai_vlc_form
par avance merci
voici mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Vlc.DotNet.Core; using Vlc.DotNet.Forms; using Vlc.DotNet.Core.Medias; using Vlc.DotNet.Core.Interop; namespace _20090426_essai_vlc_form { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Vlc.DotNet.Forms.VlcControl control = new Vlc.DotNet.Forms.VlcControl(); control.Width = 200; control.Height = 200; control.Manager.VlcLibPath = @"C:\Program Files\VideoLan\VLC\"; control.Dock = DockStyle.Fill; this.Controls.Add(control); FileMedia fileMedia = new FileMedia(); fileMedia.FilePath = @"D:\Film\Films\next.avi"; control.Manager.MediaLibrary.MediaItems.add(fileMedia); } } }
Partager