I am trying to embed a YouTube video in my Windows 10 Universal app. I know that there are ways to do this that are against the terms of YouTube, but is there a way to do this so as not to go against them?
I tried the following code and I was able to get the YouTube player. But the video does not load.
In the Initialize section
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=""https://www.youtube.com/embed/OLE5oAZanA4" + @" ? rel=0"" frameborder=""0"" allowfullscreen></iframe>";
videoView.NavigateToString(html);
User interface code
<WebView Name="videoView" HorizontalAlignment="Left" Height="297" Margin="466,150,0,0" Grid.Row="1" VerticalAlignment="Top" Width="441"/>
For those who use MyToolkit (which contradicts the terms YT). Is viewing tracking observed using this method?
source
share