2

I'm working on a flutter project involving a video streaming widget, I use this plugin:

https://pub.dartlang.org/packages/chewie

which depends on this plugin:

https://pub.dartlang.org/packages/video_player

it works fine when I use common video, basically the plugin define the video stream type based on the video url

but in my case, due to some CDN/security issue on my backend, the video url doesn't contain any file extension, and by default the plugin will use common stream type to render, yet my video is an hls stream

so I figure, it could be done if can just override the native implementation on Android and force the stream type to hls

yet, the plugin registrant is a generated class and it points to the default implementation of the plugin and not the one I create

is there something I can do to handle this beside rewrite both the plugins?

5
  • you can fork the repo , modify the classes and point to your fork Commented Oct 20, 2018 at 5:16
  • in this case, I need to fork both of them? the plugin I use and the one it depends that I wanted to change? Commented Oct 20, 2018 at 5:20
  • hmm well yeah , chewie's fork will point to your video player's fork Commented Oct 20, 2018 at 5:23
  • alrite then.... long path it is, thanks, mate! :D Commented Oct 20, 2018 at 5:26
  • you're welcome, also if you find that should be a feature send a PR to the creator's repo Commented Oct 20, 2018 at 5:29

1 Answer 1

4

I think in this case you'll have to fork both projects, video_player then chewie.

You'll have to make the changes on video_player, and make your chewie's fork point to your video_player's fork.

Also if you find that your changes could be added as a feature on video_player, send a PR to the original repo.

Point to your fork in your pubspec.yaml

chewie: 
    git:
      url: https://github.com/youruser/chewie.git

Don't forget your chewie's fork will have to point to your video_player fork.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.