Open insinfo opened 2 years ago
Hi, can you share your code and/or a sample repository? Would help me reproduce (albeit, I don't have my hands on a Windows machine right now.)
import 'package:flutter/material.dart';
import 'package:riodasostrasapp/app/shared/theme/style.dart';
import 'package:video_player/video_player.dart';
class TurismoHomePage extends StatefulWidget {
@override
State<TurismoHomePage> createState() => _TurismoHomePageState();
}
class _TurismoHomePageState extends State<TurismoHomePage> {
late VideoPlayerController _controller;
@override
void initState() {
super.initState();
_controller = VideoPlayerController.network(
'https://www.experimenteriodasostras.com.br/storage/turismo/midias/ffec8800-09d2-45a4-9b99-09ab04b057bf.mp4')
..initialize().then((_) {
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
setState(() {});
});
}
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
return Scaffold(
appBar: appBarDefault(title: 'Turismo'),
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
//video
Container(
color: Colors.amber,
width: screenSize.width,
child: _controller.value.isInitialized
? AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: VideoPlayer(_controller),
)
: Container(),
),
//menu grid
Container(
padding: EdgeInsets.all(16),
width: screenSize.width,
child: Wrap(
spacing: 16,
runSpacing: 16,
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10))),
padding: EdgeInsets.all(10),
child: Column(
children: [
Text(
'',
style: TextStyle(
fontFamily: 'pictogramas_turismo',
fontSize: 71),
)
],
),
),
],
),
),
],
),
),
),
);
}
@override
void dispose() {
super.dispose();
_controller.dispose();
}
}
pubspec.yaml
video_player: ^2.1.1
video_player_windows:
git:
url: https://github.com/anirudhb/flutter_packages.git
path: video_player_windows
@anirudhb Are you using a linux or macOS machine? Because if this plugin uses ffmpeg in theory, would you implement the same logic for linux and macos too?
Yup, I'm planning to port this to other platforms (mainly for my ease of debugging), and pending splitting this into a separate repository. Don't have too much time at the moment to do these things though.
the video is playing only blinking
https://user-images.githubusercontent.com/12227024/150841089-8ed71329-46fc-4273-a529-be92fd540f4b.mp4