开发者

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

开发者 https://www.devze.com 2023-03-09 20:10 出处:网络
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

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.S开发者_如何转开发ource = (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


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消