当我尝试使用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以不寻常的方式终止它。请联系应用程序的支持团队 了解更多信息
以下是异常图片: