繁体   English   中英

如何在Windows Phone Silverlight 8.1应用程序中将Source设置为mediaElement?

[英]How to SetSource to mediaElement in Windows Phone Silverlight 8.1 app?

我想使用此API https://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/br244338.aspx

但它具有以下要求: 支持的最低电话Windows Phone 8.1 [仅Windows运行时应用程序]

我的手机是wp8.1,我正在使用wp silverlight 8.1进行开发。

请问wpSilverlight8.1中的等效项是什么?

我尝试使用PickSingleFileAndContinue(),它在我收到视频之前可以正常工作,但我不知道如何获取流以便将流分配给我的mediaElement。

谢谢

找到了,它起作用了!

    public async void ContinueFileOpenPicker(FileOpenPickerContinuationEventArgs args)
    {
        StorageFile file = args.Files[0];

        if (file.Name.EndsWith("mp4")) {
            IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
            mediaControl.SetSource(fileStream, file.ContentType);
        ...
        }

从这里得到了想法: https : //msdn.microsoft.com/zh-cn/library/windows/apps/dn642086(v=vs.105).aspx

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM