问题
I want to integrate a Youtube Video in a Xamarin.forms Application.
Currently i have googled and found the following links:
https://www.thewissen.io/embedding-youtube-feed-xamarin-forms/
XAMARIN - add video from youtube
but they deal with only Youtube lists , but not a single Youtube video.
I would like a single Video which isn't played in a WebView
How can i tackle this?
回答1:
HtmlWebViewSource personHtmlSource = new HtmlWebViewSource();
personHtmlSource.SetBinding(HtmlWebViewSource.HtmlProperty, "HTMLDesc");
personHtmlSource.Html = @"<html><body> <div style=' position: relative; padding-bottom: 56.25%; padding-top: 25px;'> <iframe style='position: absolute; top: 0; left: 0; width: 100%; height: 100%;' src='https://www.youtube.com/embed/bVdfj7HXuXE' frameborder='0' allowfullscreen></iframe></div> </body></html>";
var browser = new WebView();
browser.Source = personHtmlSource;
Content = browser;
来源:https://stackoverflow.com/questions/45280034/single-youtube-video-embedding-in-xamarin-forms-but-not-youtube-list