none
Windows 8 Apps - Videos

    Pregunta

  • I have a button in my app , that launches a youtube webpage in a webbrowser by URI.

    But want i want to do now is have the video play in the app , so the user doesnt have to leave the app.

    I realize that i can download the video and put the video file into the Assets folder, and refer to it by a MediaFile.

    But, in the future i will be handling more than one video(it'll get tedious, not to mention the forever increasing size of the app).

    How can I play the YouTube video in the app without , having to dowload the actually video file, and without the user living the app?

    
    miércoles, 28 de noviembre de 2012 15:11

Respuestas

  • Check the YouTube sample.

    Basically all you need to do is use a WebView and its NavigateToString method:

    <WebView x:Name="YouTube" Height="335" Width="580" />
    string htmlFragment = "<iframe src='http://www.youtube.com/embed/33icee-1dK8' width='560' height='315' />";
    this.YouTube.NavigateToString(htmlFragment);


    miércoles, 28 de noviembre de 2012 15:31