Windows 8 アプリの場合、C#/Xaml で、Launcher.LaunchFileAsync を使用してコンピューター上のメディア プレーヤーでビデオを起動したいと考えています。
URLからのビデオファイルがあり、このコードを使用しています:
var uri = new Uri(myUrl,UriKind.RelativeOrAbsolute);
var file = await StorageFile.CreateStreamedFileFromUriAsync("aaa", uri, RandomAccessStreamReference.CreateFromUri(uri));
if (file != null)
{
// Launch the retrieved file
var success = await Windows.System.Launcher.LaunchFileAsync(file);
if (success)
{
// File launched
}
else
{
// File launch failed
}
}
else
{
// Could not find file
}
これは実際には、LaunchFileAsync のドキュメントのサンプル コードです。私には問題ないように思えましたが、成功は常に偽物です。理由はわかりますか?URL のビデオに LaunchFileAsync を使用することは可能ですか? それを行う別の方法はありますか?