jakky1 / video_player_win

Flutter video player for Windows, lightweight, using Windows built-in Media Foundation API. Windows implementation of the video_player plugin.
BSD 3-Clause "New" or "Revised" License
26 stars 9 forks source link

Even after installing K-lite codec I am not able to play the video only the black screen is seen with some errors #38

Open moxil198 opened 2 weeks ago

jakky1 commented 2 weeks ago

Please paste the error message, and upload the video file here that you try to play.

moxil198 commented 2 weeks ago

Syncing files to device Windows... [log] flutter: video player file opened: id=2218161676096 [video_player_win] load fail, reload now [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value

0 VideoPlayerController.initialize.errorListener (package:video_player/video_player.dart:503:51)

1 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)

2 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:386:15)

3 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:402:7)

4 _DelayedError.perform (dart:async/stream_impl.dart:552:14)

5 _PendingEvents.handleNext (dart:async/stream_impl.dart:646:11)

6 _PendingEvents.schedule. (dart:async/stream_impl.dart:617:7)

7 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)

8 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)

I placed entire example code. And the video is the bunny video which is available in video_player library

moxil198 commented 2 weeks ago

There is one more thing to add. In my olden project that is working fine in other laptops but even videos in older exe which works in other device is not working in my device so I feel that it might be due to codec so i installed k lite codec but even that is not working can you suggest what should be done and where's the issue?

jakky1 commented 2 weeks ago

@moxil198, since you said the same video file can be played in other laptops, but cannot play in your device, I have no idea how to fix it.

If this problem bothers you, please use other packages instead ... orz

moxil198 commented 2 weeks ago

@moxil198, since you said the same video file can be played in other laptops, but cannot play in your device, I have no idea how to fix it.

If this problem bothers you, please use other packages instead ... orz

Bro let me explain it in more detail:

I built an exe and installed it on another PC it works perfectly fine but when I try to run the same exe even after installing the K lite codec it is not playing the video.

Getting below details might help me:

  1. exactly ehich codec extension is required to run the video
  2. What is the process in K lite codec I mean which option we need to turn on.
  3. Are there any other softwares for that?
jakky1 commented 2 weeks ago

So, with the same exe, and the same video file, it can be played in device A, but cannot be played with device B with K-lite codec installed, right ?

You should upload the video file here. I cannot know which codec this video file uses before I got the video file.

moxil198 commented 2 weeks ago

Performing hot restart... Syncing files to device Windows... Restarted application in 824ms. [video_player_win] load fail, reload now [log] flutter: video player file opened: id=2345614043808 [log] [video_player_win] playback event: error

Video link: https://drive.google.com/file/d/1bIFwjZCkoSSQW9ksWJRSAbBi-mJjMLMX/view?usp=sharing

jakky1 commented 2 weeks ago

The video file contains AVC (H.264) video and AAC (audio). Both are supported by K-lite codec pack. It can be played in my PC with this package.

Maybe you can try the following steps:

If it still not working, I have no idea how to fix it :(

mhkarami commented 1 week ago

I have same problem. I installed K-lite codec Mega Windows Media Player can play .mkv file without problem. if there were something wrong with K-lite codec pack i could not play video with Windows Media Player. also i can play .mp4 files properly. OS: Windows 10 X64 error message :

[log] flutter: video player file opened: id=3012009284576
[video_player_win] load fail, reload now
[log] [video_player_win] playback event: error
jakky1 commented 1 week ago

@mhkarami, I push a new branch, please try with the following dependency, and let me know if this helps. and post the logs even if it works.

dependencies:
  video_player_win:
    git:
      url: https://github.com/jakky1/video_player_win.git
      ref: test_no_reload_when_error     #################### NOTEICE ~~~~~~~~~~~~~~~~~~~
mhkarami commented 1 week ago

@jakky1 new logs :

[log] flutter: video player file opened: id=2421225699824
[video_player_win] load fail, but not auto reload
[video_player_win] load fail, but not auto reload

.mp4 is ok but .mkv not . i test both local file and online video uri

    // controller = VideoPlayerController.networkUrl(Uri.parse(uri));
    controller = VideoPlayerController.network(uri);
    // controller = VideoPlayerController.file(File(".......Carls.Date.2023.720p.WEB-DL.FilmKio.mkv"));
jakky1 commented 1 week ago

@mhkarami, I add some logs. Please try again and post the logs during execution.

The same branch, please remember to flutter pub get again.

dependencies:
  video_player_win:
    git:
      url: https://github.com/jakky1/video_player_win.git
      ref: test_no_reload_when_error     #################### NOTEICE ~~~~~~~~~~~~~~~~~~~
mhkarami commented 1 week ago

@jakky1 first i run

flutter clean
flutter pub get

errors :

[log] flutter: video player file opened: id=1870265986656
[video_player_win] load fail, but not auto reload
[video_player_win] load fail, but not auto reload

for both local and network uri

jakky1 commented 1 week ago

@mhkarami, Thanks for help.

Unfortunately, I have no idea how to fix it. I will try to re-implement with new API. Maybe take several weeks... orz