locked
How to Embed Youtube video in the itemdetailpage RRS feed

  • Question

  • Hi,

    In my app i want to show(Embed) a youtube video in the itemdetail page,

    can anybody please provide me the complete code(C# and XAML)??

    Friday, September 6, 2013 6:47 AM

Answers

All replies

  • Hello.

    You can use WebView control for play youtube videos in your app. Or use "MyToolkit" for parse link and play it via MediaElement.


    Friday, September 6, 2013 7:13 AM
  • Hello Santosh,

    Check this sample, May be helpful for You:

    Youtube-Sample


    Friday, September 6, 2013 7:16 AM
  • i have used webView control but did not get it

    the code is like this

       .xaml

                

    <WebView x:Name="videoView" Height="600" Width="800">

            </WebView>

    .cs

     string str;
            

            public MainPage()
            {
                this.InitializeComponent();
                str = string.Format(@"iframe width='{0}' height='{1}' src='{2}' frameborder='{3}'/iframe", videoView.ActualWidth - 10, videoView.ActualHeight - 10, "http://youtube.googleapis.com/v/LMc_LAroq8M&feature", 0);
                videoView.NavigateToString(str);
                
                
            }

    but it did not work for me


    Friday, September 6, 2013 7:26 AM
  • Hello Santosh,

    webview is not support Iframe. Because Webview doesn't support flash, silverlight, active-x. Show this link:

    nine-things-you-need-to-know-about-webview

    Friday, September 6, 2013 7:36 AM
  • Try this

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        //Original video URL http://www.youtube.com/watch?v=VQb5caeSo00
        OpenYouTubeVideo("400", "400", "VQb5caeSo00");
    }
    
    private void OpenYouTubeVideo(string VideoWidth, string VideoHeight, string VideoID)
    {
        webView.NavigateToString(string.Format("<iframe width='{0}' height='{1}' src='http://www.youtube.com/embed/{2}' frameborder='0'></iframe>", VideoWidth, VideoHeight, VideoID));
    }
    


    Friday, September 6, 2013 9:21 AM
  • I got by using Webview control.

    Thanks for your replies

    Thursday, September 12, 2013 9:44 AM