Closed abdelaziz-mahdy closed 1 year ago
This is confusing. I'm able to play local files perfectly. There shouldn't be difference, since the video output is itself a VLC window. Make sure you're using Media.file
constructor.
For the full screen, yeah that's something needs to be handled separately with flutter_native_view
. It'd take some time too.
this is how i create the player
Player player = Player(
id: randomNumber,
commandlineArguments: [
//"-vvv",
'--http-referrer=' + refer,
'--http-reconnect',
'--sout-livehttp-caching',
'--network-caching=60000',
'--file-caching=60000'
],
registerTexture: !Platform.isWindows); // create a new video controller
if (dataSource.type == DataSourceType.asset) {
player.open(
Media.asset(dataSource.source!),
autoStart: _autoplay,
);
} else if (dataSource.type == DataSourceType.network) {
print(dataSource.source!);
player.open(
Media.network(
dataSource.source!,
timeout: Duration(seconds: 10),
//startTime: seekTo
),
autoStart: _autoplay,
);
} else {
player.open(
Media.file(
dataSource.file!,
//startTime: seekTo
),
autoStart: _autoplay,
);
}
is this wrong?
also sound is working just the screen is black
ok playing local files works, I will check more and tell you where is the main problem
looks like sometimes the code is not waiting for the UI to link
what I tested
so when using window manager 99% it doesn't link and gives a black screen
and playing network files gives the code the time to link since it takes a time to start the network video
any news?
[macOs] Same issue :(
same issue here. =( but i saw this code in another topic and worked:
ListView( shrinkWrap: true, children: [ NativeVideo( player: _videoPlayer, height: 420.0, width: 360.0, ), ], ),
In my case the screen is white.
Hi, I have decided to remove NativeVideo
widget for now in the latest version v0.4.0.
Since it is no more, this is no longer a concern. Below I have discussed the future plans:
First of all, sorry for being inactive. I've been occupied with my exams & college. Maintaining open-source packages requires consistent work & time out of daily life. Writing C++ & native code is even more tedious.
There are a number of issues with this package, both in regard of performance & stability which I would like to fix. I'm not quite satisfied with the current state of the package, though I believe it is still usable. Hardware acceleration is a big concern. Currently, a substantial amount of load is caused on the CPU when using package:dart_vlc. This is because every video frame is copied from GPU to RAM buffer (which is a CPU process & CPU isn't made for rendering) for drawing it into Flutter's texture widget, both due to Flutter & libvlc's limitations at that time.
I made NativeVideo
widget for bringing hardware-acceleration but as it turns out, it is not exactly good & stable alternative i.e. it uses undocumented API from Windows, has other issues while rendering inside widget tree (like you shared). It simply worked by creating another window under actual Flutter window & making a section of Flutter app transparent to display video through it. Thus, a hacky solution.
Now, my work is sponsored by Stream. I can now proceed my work with peace & build the best-ever performant & stable video library for Flutter Desktop. I attempted to render using OpenGL the other day: flutter-windows-ANGLE-OpenGL-Direct3D-Interop. I will continue this work.
Thanks!
Describe the bug
Flutter native view all black (when playing local file) but the view is working correctly on links
Another issue when going to full screen using window manager the top bar of flutter native view doesn't go away also, there is a space on each edge (my guess related to flutter native view too)
Media
downloaded video files
Minimal reproducible code
https://github.com/zezo357/flutter_meedu_videoplayer
Flutter logs
Operating system:
Other details:
dart_vlc
.dart_vlc
.Screenshots