gusaindpk
gusaindpk

Reputation: 1253

windows phone app how to intergrate video player using only c# code

in my application i want to navigate from a page which is extending Canvas to the video player for video player page i hav created one class and i m doing this there

 MediaElement videoPlayer = new MediaElement();
 videoPlayer.Source = (new Uri("some video url", UriKind.Absolute));
 videoPlayer.AutoPlay = true;
 videoPlayer.Play();

but when i m going to that page nothing is happning can some body tell me what i m missing. i am new to windows development. thanks is advance

Upvotes: 2

Views: 1195

Answers (1)

keyboardP
keyboardP

Reputation: 69392

You need to insert the MediaElement into your VisualTree. For example, if your canvas' name is LayoutRoot (the default), you could to this:

LayoutRoot.Children.Add(videoPlayer);

Upvotes: 2

Related Questions