多个 WPF MediaElement 无法正常工作
我只是想知道为什么两个视频不能同时播放?仅播放 1 个视频,第二个则不播放。但第二个视频有声音……这很奇怪!有什么线索吗?谢谢!
<Grid>
<MediaElement Height="299" HorizontalAlignment="Left" Name="mediaElement1" VerticalAlignment="Top" Width="213" LoadedBehavior="Manual" />
<MediaElement Height="299" HorizontalAlignment="Left" Margin="231,0,0,0" Name="mediaElement2" VerticalAlignment="Top" Width="260" LoadedBehavior="Manual" />
</Grid>
更新:
我发现它的工作原理就像我所说的那样,仅在 Visual Studio 的调试模式下。
I just want to know why 2 video doesn't work at the same time? Only 1 video plays and the second doesn't. But there is a sound of the second video... That's odd! Any clue? Thanks!
<Grid>
<MediaElement Height="299" HorizontalAlignment="Left" Name="mediaElement1" VerticalAlignment="Top" Width="213" LoadedBehavior="Manual" />
<MediaElement Height="299" HorizontalAlignment="Left" Margin="231,0,0,0" Name="mediaElement2" VerticalAlignment="Top" Width="260" LoadedBehavior="Manual" />
</Grid>
UPDATES:
As I found it works like I said under DEBUG mode of Visual Studio only.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 WPF 中播放 2 个视频不是问题。您如何加载视频?
只需确保视频路径正确即可。
如果您在项目中添加视频,请确保它设置了以下属性:
Playing 2 videos in WPF is NOT an issue. How are you loading the videos?
Just make sure that the video path is correct.
If you add the the video in your project make sure it has the following properties set: