如何在 WinRT 中播放 D 盘上的视频文件? [英] How to Play Video File On D Drive In WinRT?

查看:23
本文介绍了如何在 WinRT 中播放 D 盘上的视频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 WindowsMetro"应用程序中使用 XAML C# 如何播放某个视频文件.示例:

Using XAML C# in Windows "Metro" Apps how do I go about playing a certain video file. Examples:

  • D:\video1.wmv
  • \\MEDIAPC\video2.wmv

到目前为止,我设法让它工作的唯一方法是使用 FilePicker,但我不想使用它,因为我已经有了要播放的文件列表.

The only way I managed to get this working so far is by using FilePicker, but I don't want to use this as I already have a list of files to play.

我曾尝试使用 GetFileFromPathAsync,但我不断遇到权限/访问问题

I have tried to use GetFileFromPathAsync but I keep getting permission / access issues

 await StorageFile.GetFileFromPathAsync(@"D:\video1.wmv");

抱歉,如果有人回答了这个问题,我只是找不到适合我的问题的答案.

Apologies if this has been answered I just couldn't find an answer that fits my problem.

推荐答案

如果您的 D:\ 驱动器是非网络资源,请尝试添加可移动存储应用程序功能.这可以通过双击 Package.appxmanifest 并导航到 Capabilities 选项卡来完成.默认情况下,您的应用程序(假设它是 Windows 应用商店应用程序)只能访问与您的应用程序一起打包的本地文件或存储在 local/roaming/temp 文件夹(通常为应用程序状态保留)中的文件.

If your D:\ drive is a non-network resource try adding the Removable storage application capability. This can be accomplished by double-clicking on the Package.appxmanifest and navigating to the Capabilities tab. By default your application (assuming it is a Windows Store app) only has access to local files packaged with your app or files stored in local/roaming/temp folders (usually reserved for Application state).

如果您的数据存储在需要身份验证的网络资源上,您将需要启用企业身份验证功能.

If your data is stored on a Network resource that requires authentication you will want to enable the Enterprise Authentication capability.

如果您不访问需要网络身份验证的资源,您可能还想为 \MEDIAPC\ 文件处理家庭和工作网络.

You may also want to fiddle with the Home and Work Networks for the \MEDIAPC\ files if you aren't accessing resources that require network authentication.

进一步阅读:

这篇关于如何在 WinRT 中播放 D 盘上的视频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆