Reputation: 718
I am new to Windows Phone app development and I would like to know what is the best way to embed YouTube videos in Windows Phone 8 App? I would like to provide a list of videos with thumbnails and user should be able to click and watch the video just like any typical app.
Thanks a lot.
Upvotes: 0
Views: 1511
Reputation: 8348
First try creating sample video application in Windows Phone App Studio which uses YouTube API services and display videos in application.
Download the source code and refer, How it uses YouTube API services and gets video. Source code will be in MVVM pattern and its the best way to implement. You may get some basic knowledge on how to develop apps that uses YouTube services.
You can refer the source code which uses YouTube API services, which I generated for more information.
Upvotes: 0
Reputation: 2994
I had tried some third party SDKs while I was doing this for Windows 8 but was not happy with any of the solutions.
Finally I resorted to embedding the video in a Web View control and the output was pretty desirable. I have not tried this on Windows Phone but should work as it did on Windows 8 since the underlying browser is the same. Try it out:-
string html = @"<style> body{margin:0; padding:0;} iframe{width:100%;height:480px;}@media screen and (max-width:300px) { iframe{width:100%;height:180px;}} </style><iframe style=""padding:0px;margin-bottom:-20px;"" src=""http://www.youtube.com/embed/" + videoId + @"?rel=0"" frameborder=""0"" allowfullscreen></iframe>";
videoView.NavigateToString(html);
Let me know if this worked for you
Upvotes: 1