VLC媒体元素,VLC无法打开mrl

时间:2017-05-15 09:43:02

标签: c# media vlc uwp-xaml libvlc

我正在制作一个包含VLC媒体元素的UWP应用,可在此链接中看到:https://github.com/kakone/VLC.MediaElement

我正在按照示例代码播放github项目中的视频文件。(我在上面提到过)。但有时会出现以下错误。

  

您的输入无法打开vlc无法打开mrl   winrt:// {GUID-string-token-is-here}查看日志以获取更多详细信息。

我已经检查了apppackage / localstoragecache文件夹中的日志文件,我在日志中发现了以下错误:

  

[core](../../ src / video_output / display.c:934)无法更改缩放

     

[core](../../ src / video_output / display.c:949)无法设置在顶部

     

[core](../../ src / video_output / display.c:973)无法更改源AR

     

[core](../../ src / video_output/display.c:1055)无法更改视点

     

[core](../../ src / video_output / display.c:934)无法更改缩放

     

[core](../../ src / video_output / display.c:973)无法更改源AR

我认为错误消息与我的xaml或C#实现无关(因为它看起来像VLC或libvlc媒体库的纯问题,它在vlc Media Element for UWP后面使用),但我还想提供代码以防万一。

XAML

<vlc:MediaElement Style="{StaticResource VLCStyle}" 
                  x:Name="Media">
</vlc:MediaElement>

C#

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    //SingleVideoToPlay is just an object of class video which I am using in my app.
    PlayNextFile(SingleVideoToPlay);
}
private void PlayNextFile(Video VideoToPlay)
{
    var FILE_TOKEN = StorageApplicationPermissions.FutureAccessList.Add(VideoToPlay.file);
    Media.PosterSource = VideoToPlay.Thumbnail;
    Media.Source = null;
    Media.Source = $"winrt://{FILE_TOKEN}";
}

public class Video
{
    public string Name { get; set; }
    public ImageSource Thumbnail { get; set; }
    public string Duration { get; set; }
    public string Views { get; set; }
    public string ParentName { get; set; }
    public StorageFile file { get; set; } 
}

0 个答案:

没有答案