网格上的多个视频

时间:2017-11-27 19:59:04

标签: c# wpf

当我尝试使用MediaTimeline在网格上显示多个(9)视频时出现错误。抛出C ++异常。如果我尝试重新启动应用程序,有时它会工作,有时我会收到错误。

这是我的代码:

        MediaTimeline timeline = new MediaTimeline(new Uri(videoPath, UriKind.Absolute));
        timeline.RepeatBehavior = RepeatBehavior.Forever;
        MediaClock clock = timeline.CreateClock();
        MediaPlayer player = new MediaPlayer();
        player.Clock = clock;
        player.Volume = 0;
        VideoDrawing drawing = new VideoDrawing();
        drawing.Rect = new Rect(0, 0, 300, 300);
        drawing.Player = player;
        DrawingBrush brush = new DrawingBrush(drawing);
        Label label = new Label();
        label.Background = brush;
        label.Margin = new Thickness(margin);

以下是异常消息:

  

Microsoft Visual C ++运行时库   运行时错误!应用程序已请求Runtime以不寻常的方式终止它。请联系应用程序的支持团队   了解更多信息

以下是异常图片:

 Microsoft Visual C++ Runtime Library Runtime Error!

0 个答案:

没有答案