video_player_win
video_player_win copied to clipboard
Video sometimes don't play when starting more than one video at once
Hi,
Thanks for the excellent package!
We've run into an issue when showing multiple video players on the screen at once, the setVolume function only affects the last video added.
Hi,
From video_player_win
version 2.2.0,
setVolume() only affects the specified VideoPlayerController.
( before 2.2.0, setVolume() affects all the other videos, but that's a bug, and fixed in 2.2.0 )
If you want to set all the volumes of video players, you need to set one by one.
Thanks for the info, sorry for not first checking I was using the latest version.
It looks like I'm having trouble getting the app compile when using the latest version alongside the video_player_macos package.
Resolving dependencies... Because every version of video_player_macos depends on video_player_platform_interface ^5.1.1 and video_player_win >=1.1.6 depends on video_player_platform_interface ^6.0.1, video_player_macos is incompatible with video_player_win >=1.1.6. So, because mudeo depends on both video_player_win ^2.2.0 and video_player_macos any, version solving failed.
I'll follow up with the video_player_macos package.
I found this issue: https://github.com/ollyde/flutter_macos_video_player/issues/14
Changing our pubspec to the following enabled it compile with the latest version:
video_player: ^2.5.3
video_player_win: ^2.2.0
video_player_macos:
git:
url: https://github.com/ollyde/flutter_macos_video_player.git
path: packages/video_player/video_player_macos
However it seem like it's now actually worse. Before the videos would always play but there was the problem with setVolume whereas now many videos aren't able to play and no videos have sound. Any ideas?
On which OS the issues you mentioned occurs?
If it occurs in Windows, could you please describe more details?
If it occurs in MacOS, since I have no Mac devices, so please contact the video_player_macos
package owner.
The issues affect the Windows version of the app. I've tried completely removing the video_player_macos package from the app and I'm still seeing problems.
Between the old version and the new versions some things have improved and other things have degraded. The rotation of the videos seems to more correct however the videos aren't auto-playing correctly and I don't hear any sound. If you're up for trying out my app it can be downloaded here: http://github.com/hillelcoren/mudeo
I noticed on the readme info about codecs. With the older version of the package the videos worked without adding any codecs, is it possible with the new version the codecs are now required?
Thanks for your help!
After video_player_win
2.2.0 (or 2.0.0),
yes sometimes video doesn't play if you start more than 2 videos simultaneously.
It is really a bug. However, I'm focus on other project now, and I have no time to fix this in a short time :( I'll try to fix it if I have time
Temp solution:
- reload video manually if user see the video not play... XD
- don't load videos at the same time, maybe with about 300ms~1000ms interval (I have not test on it)
- rollback to
video_player_win: 1.1.6
, however the CPU usage may be high, depends on what you played and how many video you played simultaneously
That probably explains it, the app is a multi-track video player/recorder so many videos are playing at once.
I'll update the issue title, thanks again!
One thought, is it worth adding a parameter to optionally disable hardware acceleration until it's more stable?
Fixed. Only push to github
dependencies:
video_player_win:
git:
url: https://github.com/jakky1/video_player_win.git
ref: master
However, sometimes (3%, only occurs when open multiple videos at once) video not auto play (only display first frame), can be recovered by calling pause()/play()
It's a massive improvement, thank you!!
3% would be fine but I'm seeing closer to 30% black screens. Calling stop/play does fix it though so there is a workaround when it happens.
_playVideos();
if (Platform.isWindows) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
_pauseVideos();
WidgetsBinding.instance.addPostFrameCallback((_) async {
_playVideos();
});
});
}
I think I found the root cause about video freeze (maybe) I tried to open 100 times with each time open two 720p videos at the same time, and no video freeze at the beginning of 3 seconds.
I push to github only.
Please try it and
remember to @flutter pub get
@ to pull the latest version from github,
and mark the temp solution you mentioned above first.
Hope this solution also works in your environment.
There may be a small improvement however the app still works much better if I include the code above to start/stop/start the videos. Thanks again for your help with this!
Hi,
I just push video_player_win: ^2.2.2
to pub.dev
and maybe this version solve this issue.
I'll close this issue if no response in 7 days.
Thanks! I'll give it a try...
It keeps improving but I'm still seeing some errors. Note: in some cases our app can play up to 5 videos at once.