MediaElement 不支持 silverlight

发布于 2024-12-24 21:14:05 字数 342 浏览 6 评论 0原文

看看我有这样的代码。

<MediaElement Source="Wildlife.wmv"/>

它不起作用。这个文件 Wildlife 已放置在我的项目中,我更改了 Wildlife.wmv 的属性,在资源上构建操作并且它有效!但是它对我来说没有用,因为我正在使用这样的绑定:

   <MediaElement Source={Binding ...}> 

我的问题如果我从 openfiledialog 获取视频文件并且无法更改构建操作动态,我该怎么办???它不起作用,我在某些控件中找不到构建操作,否则?

Look I have like this code.

<MediaElement Source="Wildlife.wmv"/>

It didn't work.This file wildlife has placed in my project, I have changed in properties of Wildlife.wmv, Build Action on Resorces and it works!!!But it's useless for me becouse I'm using binding like this:

   <MediaElement Source={Binding ...}> 

My question what I have to do if I take video file from openfiledialog and I can't change build action dynamic???It doesn't work, i can't find build action in some control or else?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只怪假的太真实 2024-12-31 21:14:05

请尝试查看此处:更改 MediaElement (SILVERLIGHT) 中的源

我认为它可能会回答您的问题问题:

MyMediaElement.Stop();
Uri u = new Uri(openfiledialog.FileName, UriKind.Absolute);
MyMediaElement.Source=u;
MyMediaElement.Play();

也许您也可以使用 Jason 的答案,并将 AutoPlay 属性设置为 true。
请注意。

Please try looking here: Change Source in MediaElement (SILVERLIGHT)

I think it may answer your question:

MyMediaElement.Stop();
Uri u = new Uri(openfiledialog.FileName, UriKind.Absolute);
MyMediaElement.Source=u;
MyMediaElement.Play();

Maybe you can also use Jason's answer there, and set the AutoPlay attribute to true.
Reagrds.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文