[UWP]如何在UWP webView中加载嵌入式Vedio

人气:820 发布:2022-09-22 其他开发语言 wpdevelop

问题描述

我有一个要求,其中我有字符串格式的HTML内容,当我在webview中将内容导航为NavigateToString时内容嵌入视频,它没有加载我的嵌入式视频。

I have a Requirement where i have HTML content in string format which content embedded video when I'm navigating the content in webview as NavigateToString it doesn't load my embedded video.

有没有办法解决它

推荐答案

您好akshay692,

Hello akshay692

尝试使用 " MS-APPX幅://" uri计划。

Try specifying your video resource(embeddedas a "Content" in your appx package) by using "ms-appx-web://" uri scheme.

    myWebView.NavigateToString(
        "<html><body>"
        + "<video src=\"ms-appx-web:///video.mp4\" controls/>"
        + "</body></html>"
    );

708