Xamarin形式嵌入单个Youtube视频,但不包含Youtube列表 [英] Single Youtube Video Embedding in Xamarin Forms but Not Youtube list
本文介绍了Xamarin形式嵌入单个Youtube视频,但不包含Youtube列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将YouTube视频集成到Xamarin.forms
应用程序中.
I want to integrate a Youtube Video in a Xamarin.forms
Application.
目前,我已经在Google上进行了搜索,并找到了以下链接:
Currently i have googled and found the following links:
https://www.thewissen.io/embedding-youtube- feed-xamarin-forms/
但是他们只处理Youtube列表,而不处理单个Youtube视频.
but they deal with only Youtube lists , but not a single Youtube video.
我想要一个不能在WebView
我该如何解决?
推荐答案
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;
这篇关于Xamarin形式嵌入单个Youtube视频,但不包含Youtube列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文