【问题标题】:How to SetSource to mediaElement in Windows Phone Silverlight 8.1 app?如何在 Windows Phone Silverlight 8.1 应用程序中将源设置为 mediaElement?
【发布时间】:2015-04-15 10:45:06
【问题描述】:

我想使用这个 API https://msdn.microsoft.com/en-us/library/windows/apps/xaml/br244338.aspx

但它有这个要求:最低支持电话 Windows Phone 8.1 [仅限 Windows 运行时应用]

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

请问 wpSilverlight8.1 中的等价物是什么?

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

谢谢

【问题讨论】:

    标签: c# silverlight windows-phone-8


    【解决方案1】:

    找到它并且它有效!

        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/en-us/library/windows/apps/dn642086(v=vs.105).aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多