0

I have dispalyed videosongs in list box.And when i click on a particular videosong it should be navigated to other page and play. My code for playing is

Xaml code:

<StackPanel  VerticalAlignment="Top" Height="600" Margin="0,0,0,0">
    <TextBlock x:Name="title" TextWrapping="Wrap"  VerticalAlignment="Top" Height="40"></TextBlock>
    <phone:WebBrowser x:Name="webBrowser" Height="411"  IsScriptEnabled="True" Margin="10,0,78,0" />

Xaml.cs:

 public Videopage()
{
    InitializeComponent();
    string video = "<iframe src=";http://www.youtube.com/embed/JJYNDFxtUIg" width="646" height="365" frameborder="0" allowfullscreen></iframe> 
    this.Navigate.ToString(video);
}

I was coming across error:

Error 1 'videosongs.Videopage' does not contain a definition for 'Navigate' and no extension method 'Navigate' accepting a first argument of type 'videosongs.Videopage' could be found (are you missing a using directive or an assembly reference?)

Anybody please help me. I was trying this app from many days.I have tried in many methods also.Even though i was i was unable to play videos.When the page was navigated blank screen was displaying in the emulator.I was using windows7.1 emulator.

Many thanks in advance.

1 Answer 1

0

Try:

this.webBrowser.NavigateToString(video);

You were calling navigate on the page, not on the browser control.

You also have bigger issues. You're original code wasn't formatted correctly and included a an incorrect/invalid semi-colon before the URI. It should have been:

string video = "<iframe src=\"http://www.youtube.com/embed/JJYNDFxtUIg\" width=\"646\" height=\"365\" frameborder=\"0\" allowfullscreen></iframe>";

Even this won't help you though as YouTube won't play the embedded content in an iframe in an embedded browser.

This will display the photoframe though though. And when tapped the film will be opened in the native player. It won't play embedded within the page.

string video = "http://www.youtube.com/embed/JJYNDFxtUIg";
this.webBrowser.Navigate(new Uri(video));
2
  • After writing the above code error was not there.No warnings also. But only blank screen was appearing and video is not playing.please give me solution for this.Trying from many days.
    – Naga
    Commented Jun 19, 2014 at 6:34
  • Yes sir the video was playing.But the song whose embed code was mentioned in the code was playing.If we want to play all the videos in list box.Can we use loops for this. Many thanks sir.
    – Naga
    Commented Jun 19, 2014 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.