本文介绍了从外部控制MediaElement的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个非常简单的WPF应用程序,其中包含MediaElement.

<MediaElement Name="mediaplayer" Source="C:\movie1.avi" LoadedBehavior="Manual"/>

是否可以通过完全独立的应用程序控制MediaElement?理想情况下是通过以太网连接的另一台计算机上吗?

目的是能够播放/暂停MediaElement并选择一个新的源.我绝对不知道从哪里开始,所以我们将不胜感激.

预先感谢,
Alex

Hi Guys,

I have a very simple WPF application that contains a MediaElement.

<MediaElement Name="mediaplayer" Source="C:\movie1.avi" LoadedBehavior="Manual"/>

Is it possible to control the MediaElement through a completely seperate application? Ideally on another computer connected via ethernet?

The goal is to be able to Play/Pause the MediaElement and select a new source. I have absolutly no idea where to start so any help would be greatly appreciated.

Thanks in advance,
Alex

推荐答案

写道:​​

是否可以通过完全控制MediaElement单独的应用程序?理想情况下是在通过以太网连接的另一台计算机上?

Is it possible to control the MediaElement through a completely seperate application? Ideally on another computer connected via ethernet?



是的.您必须在应用程序中编写代码以侦听通信,并在单独的应用程序中与应用程序通信.我建议您为此使用WCF.



Yes. You''d have to write the code in your app to listen for communication, and a seperate app to communicate with your app. I''d suggest you''d use WCF for this.


这篇关于从外部控制MediaElement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 00:12