0

MediaFailed 事件不时触发两次,我的 xaml 如下:

<controls:MediaUriElement Name="videoMedia" HorizontalAlignment="Center" Margin="20 20 20 5" VerticalAlignment="Center"
 DeeperColor="False" VideoRenderer="EnhancedVideoRenderer" UnloadedBehavior="Stop"
 MediaOpened="videoMedia_MediaOpened" MediaFailed="videoMedia_MediaFailed"
/>

第一个 MediaFailedEventArgs.Exception 的信息如下: Message "The download of the specified resource has failed" Source "DirectShowLib-2005" StackTrace:

"  at DirectShowLib.DsError.ThrowExceptionForHR(Int32 hr)\r\n   at WPFMediaKit.DirectShow.MediaPlayers.MediaUriPlayer.oldOpenSource()"

第二个例外如下:消息“未指定的错误”源“DirectShowLib-2005”StackTrace:

"   at DirectShowLib.DsError.ThrowExceptionForHR(Int32 hr)\r\n   at WPFMediaKit.DirectShow.MediaPlayers.MediaUriPlayer.OpenSource()"

注意:因为我的应用程序是 .NET 4.0 的目标,所以我更改了源代码并在我的本地机器上重新生成,源代码更改为:更改 D3DRenderer.cs from D3DImage.SetBackBuffer(D3DResourceType.IDirect3DSurface9, backBuffer, true); 到 D3DImage.SetBackBuffer(D3DResourceType.IDirect3DSurface9, backBuffer);

4

0 回答 0