locked
how to embed YouTube video xaml

    Question

  • how can i embed YouTube video in metro style application using xaml ?
    Monday, July 09, 2012 7:25 PM

Answers

  •   Hello

     use WebView controll

               string htmlFragment =
        @"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
                    <html>
                       <head>
                          <title>YouTubePagesample</title>
                       </head>
    <iframe width='560' height='315' src='http://www.youtube.com/embed/{YoutubeID}' frameborder='0' allowfullscreen></iframe>
                       <body>
                       </body>
                    </html>;";
                this.webView.NavigateToString(htmlFragment);

    Tuesday, July 10, 2012 10:04 AM
  • http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e9a17fb3-abff-41e2-82c7-8d58054271fa

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Monday, July 09, 2012 8:05 PM
    Moderator
  • YouTube has a beta program to provide some videos in HTML5. You can join it at http://youtube.com/html5 . Once you have done that you should be able to embed HTML5 YouTube videos in a WebView control by navigating to the YouTube URL.

    Flash videos cannot be displayed in a Metro style app.

    --Rob

    Monday, July 09, 2012 8:13 PM
    Owner

All replies

  • http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e9a17fb3-abff-41e2-82c7-8d58054271fa

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Monday, July 09, 2012 8:05 PM
    Moderator
  • YouTube has a beta program to provide some videos in HTML5. You can join it at http://youtube.com/html5 . Once you have done that you should be able to embed HTML5 YouTube videos in a WebView control by navigating to the YouTube URL.

    Flash videos cannot be displayed in a Metro style app.

    --Rob

    Monday, July 09, 2012 8:13 PM
    Owner
  •   Hello

     use WebView controll

               string htmlFragment =
        @"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
                    <html>
                       <head>
                          <title>YouTubePagesample</title>
                       </head>
    <iframe width='560' height='315' src='http://www.youtube.com/embed/{YoutubeID}' frameborder='0' allowfullscreen></iframe>
                       <body>
                       </body>
                    </html>;";
                this.webView.NavigateToString(htmlFragment);

    Tuesday, July 10, 2012 10:04 AM
  • How to use that WebView? its sealed class...

    Thursday, August 29, 2013 10:14 AM