Puede utilizar iframe como se describe en https://developers.google.com/youtube/iframe_api_reference
No sigo los consejos de Google exactamente, pero este es el código que estoy usando y funciona bien
public class CWebVideoView {
private String url;
private Context context;
private WebView webview;
private static final String HTML_TEMPLATE = "webvideo.html";
public CWebVideoView(Context context, WebView webview) {
this.webview = webview;
this.context = context;
webview.setBackgroundColor(0);
webview.getSettings().setJavaScriptEnabled(true);
}
public void load(String url){
this.url = url;
String data = readFromfile(HTML_TEMPLATE, context);
data = data.replace("%1", url);
webview.loadData(data, "text/html", "UTF-8");
}
public String readFromfile(String fileName, Context context) {
StringBuilder returnString = new StringBuilder();
InputStream fIn = null;
InputStreamReader isr = null;
BufferedReader input = null;
try {
fIn = context.getResources().getAssets().open(fileName, Context.MODE_WORLD_READABLE);
isr = new InputStreamReader(fIn);
input = new BufferedReader(isr);
String line = "";
while ((line = input.readLine()) != null) {
returnString.append(line);
}
} catch (Exception e) {
e.getMessage();
} finally {
try {
if (isr != null)
isr.close();
if (fIn != null)
fIn.close();
if (input != null)
input.close();
} catch (Exception e2) {
e2.getMessage();
}
}
return returnString.toString();
}
public void reload() {
if (url!=null){
load(url);
}
}
}
en / assets tengo un archivo llamado webvideo.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
iframe { border: 0; position:fixed; width:100%; height:100%; bgcolor="#000000"; }
body { margin: 0; bgcolor="#000000"; }
</style>
</head>
<body>
<iframe src="%1" frameborder="0" allowfullscreen></iframe>
</body>
</html>
y ahora defino una vista web dentro de mi diseño principal
<WebView
android:id="@+id/video"
android:visibility="gone"
android:background="#000000"
android:layout_centerInParent="true"
android:layout_width="match_parent"
android:layout_height="match_parent" />
y uso CWebVideoView dentro de mi actividad
videoView = (WebView) view.findViewById(R.id.video);
videoView.setVisibility(View.VISIBLE);
cWebVideoView = new CWebVideoView(context, videoView);
cWebVideoView.load(url);