我想全屏显示YouTube视频。所以我尝试了下面的代码,但所有这些代码都显示白屏(不工作)。这两个按钮都不起作用(我尝试嵌入一个没有嵌入的URL)。我怎样才能设置我的代码:
floatingActionButton1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
wv.loadUrl("<iframe src=\"https://www.youtube.com/watch?v=UNhTOm1DNFE\"\n" + " allowfullscreen=\"allowfullscreen\"\n" + " mozallowfullscreen=\"mozallowfullscreen\"\n" + " msallowfullscreen=\"msallowfullscreen\"\n" + " oallowfullscreen=\"oallowfullscreen\"\n" + " webkitallowfullscreen=\"webkitallowfullscreen\"> </iframe>");
}
});
floatingActionButton2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
wv.loadUrl("https://www.youtube.com/embed/p2KnvF0hkLI?autoplay=1");
}
});