本文主要是介绍Flutter-实现视频播放功能,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.引入库。
video_player: ^0.10.0+2
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:video_player/video_player.dart';void main() => runApp(showVideo());class showVideo extends StatefulWidget {@overrideState<StatefulWidget> createState() {// TODO: implement createStatereturn new _VideoAppState();} }class _VideoAppState extends State<showVideo> {VideoPlayerController _controller;@overridevoid initState() {super.initState();_controller = VideoPlayerController.network('http://192.168.19.233/topwayims/files/1564539968501_video.mp4')..initialize().then((_) {setState(() {});});}@overrideWidget bu
这篇关于Flutter-实现视频播放功能的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!