我在下面有这个代码,我喜欢显示facebook上的视频来扑动app . 但相反它只显示视频的链接,当我点击链接它带我到Facebook视频 . 我只想显示视频而不是链接,请帮忙 .
import 'package:flutter/material.dart';
import 'package:flutter_html_view/flutter_html_view.dart';
//import 'package:html2md/html2md.dart';
//import 'package:flutter_markdown/flutter_markdown.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
String html = '<div class="fb-video" data-href="https://www.facebook.com/FacebookAU/videos/10152167660372415/" data-width="500" data-show-text="true"><blockquote cite="https://www.facebook.com/FacebookAU/videos/10152167660372415/" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/FacebookAU/videos/10152167660372415/">Happy New You</a><p>Here’s to a healthier, dancier, artier, funner New You in 2014.</p>Posted by <a href="https://www.facebook.com/FacebookAU/">Facebook</a> on Wednesday, January 8, 2014</blockquote></div>';
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Plugin example app'),
),
body: new SingleChildScrollView(
child: new Center(
child: new HtmlView(data: html),
),
),
),
);
}
}
1 回答
您需要使用videoplayer包https://pub.dartlang.org/packages/video_player或者如果您打算使用html视图执行更多操作,可以使用flutter Html视图包使用视频标签嵌入视频https://pub.dartlang.org/packages/flutter_html_view