i search information how to add video from youtube, example: I want add video from some youtube link. I think that it should be in webview, but i need some details, because i can't find any information about my problem.
You can use the webview to play youtube video.
string html=@"<html><body><iframe width=""200"" height=""400"" src=""strUrl""></iframe></body></html>";
var myWebView = ( WebView ) FindViewById ( Resource.Id.myWebView );
var settings=myWebView.Settings;
settings.JavaScriptEnabled=true;
settings.UseWideViewPort=true;
settings.LoadWithOverviewMode=true;
settings.JavaScriptCanOpenWindowsAutomatically=true;
settings.DomStorageEnabled=true;
settings.SetRenderPriority(WebSettings.RenderPriority.High);
settings.BuiltInZoomControls = false;
settings.JavaScriptCanOpenWindowsAutomatically=true;
myWebView.SetWebChromeClient(new WebChromeClient());
settings.AllowFileAccess = true;
settings.SetPluginState(WebSettings.PluginState.On);
myWebView.LoadDataWithBaseURL(null,html,"text/html","UTF-8",null);
Add internet permission in manifest file and enable hardwareAccelerated="true". Follow this my blog entry for more detail : http://appliedcodelog.blogspot.in/2015/09/how-to-play-youtube-video-using-webview.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With