Bonjour,
j'essaye depuis peu d'ouvrir un vidéo via un "MediaElement", sauf que j'obtiens une exception que je ne comprend pas.
Voici le code :
Code xaml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <MediaElement Name="medial" Source="C:\Users\Kira\Desktop\l.mp3"/> </Grid> </Window>
et voici l'exception que j'obtiens lorsque je mets le liens (source) de ma vidéo :
System.InvalidOperationException
File d'attente vide.
à System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
à System.Collections.Generic.Queue`1.Dequeue()
à Microsoft.Expression.WpfPlatform.InstanceBuilders.MediaElementThumnailGrabber.MoveToNextWorkItem(BitmapSource image, String errorMessage)
à Microsoft.Expression.WpfPlatform.InstanceBuilders.MediaElementThumnailGrabber.OnMediaFailed(Object sender, ExceptionEventArgs e)
à System.Windows.Media.UniqueEventHelper`1.InvokeEvents(Object sender, TEventArgs args)
à System.Windows.Media.MediaEventsHelper.OnMediaFailed(Object o)
à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
à System.Windows.Threading.DispatcherOperation.InvokeImpl()
à System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Windows.Threading.DispatcherOperation.Invoke()
à System.Windows.Threading.Dispatcher.ProcessQueue()
à System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
à System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
à System.Windows.Threading.Dispatcher.Run()
à System.Windows.Application.RunDispatcher(Object ignore)
à System.Windows.Application.RunInternal(Window window)
à System.Windows.Application.Run(Window window)
à System.Windows.Application.Run()
à Microsoft.Expression.DesignHost.Isolation.DesignerProcess.RunApplication()
à Microsoft.Expression.DesignHost.Isolation.DesignerProcess.<>c__DisplayClass2.<Main>b__0()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
Bien que j'ai cette exception le programme se lance mais ne m'ouvre qu'une fenêtre sans rien dessus.
Partager