-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[video_player] duration updates event #3983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[video_player] duration updates event #3983
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Thanks for the contribution! This needs to follow the process described at https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins |
packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart
Outdated
Show resolved
Hide resolved
|
https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins following this i should get an approval on this first, then i should open a pr with the changes in the platform interface alone, i did add the required tests in video_player, is there something else i should do, or only the approval remaining? |
hellohuanlin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this PR complete? I do not see relevant logic on native side that listens to duration change event.
| ## NEXT | ||
|
|
||
| * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. | ||
| * Adds listener to `VideoEventType.durationUpdated`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a version bump so it can be released
As explained in the description, I am a maintainer of a package that uses video_player package So this change will help me greatly in my development of the package video_player_media_kit, since I do have duration updates there when playing live streams I didn't implement the native side due to not having enough knowledge on how it should be handled correctly, I just implemented the platform interface enum, video_player listener and test Which I need in my package, if other changes are required let me know Also this change is a change of api right? So it should affect 0.x.0 the x version correct? |
|
can you provide more details on when the duration will change? is it specific to your package? or is it general behavior that this package may use in the future? is there other workarounds (such as using your own interface?) |
The duration changes when playing a live stream m3u8, while playing the duration will keep increasing It's a specific behavior in media_kit which the layer I use to play videos on desktop Does exo player or iOS native use it and it's ignored in this package, I don't know sadly If I use my own interface I will have to use my own video_player and that will break the idea of me integrating easily with the video_player package and will have to handle updates whenever this package is updated keeping in mind it's all for a small change. |
Please file an issue (you've checked the box, but didn't actually file an issue) with a reproducible test case, so that we can address this:
There's no inherent issue with us adding a new API that is only used by some implementations, but I'd like to understand if that's actually the case here, and if so why. In at least some cases, both AVPlayer and ExoPlayer will report an unknown time value for live streams, and we should determine:
|
The issue is related to my package should I file an issue when it's not a video_player issue? Media_kit does the duration thing to allow people to seeking back when playing live videos I may check exoplayer and avplayer if they allow this type of implemention and comment again for this details |
You are trying to add functionality to |
I am adding a feature in video_player that will help me fix an issue in my platform interface For video_player it's a feature For me it's a fix for an issue |
|
The Flutter issue tracker (like most issue trackers) tracks both bug reports and feature requests, so I'm not sure why you are concerned about the distinction. |
In that case, I will open an issue explaining that playing live streams don't provide the duration updates, which is limiting the functionality of seeking back when playing I guess that is a good general issue |
|
@zezo357 Are you still planning on opening an issue for this to continue discussion? |
Yes I am just busy these days, I found out exo player has this behavior (https://exoplayer.dev/live-streaming.html) Of increasing the duration for live streams, But didn't check iOS, anyway i will work on creating the issue and android implementation when i got time |
|
I created an issue |
|
Thank you for your contribution. It looks like the tests are failing. Before we review the PR, please see what you can do to resolve the test failures. If you are unsure how to proceed, please reach out for help on the #hackers-new channel. |
|
I'm going to mark this as a draft for now while the question of what other platforms would do with this is resolved in the issue. |
|
Since this is marked as a draft and hasn't been updated in several months I'm going to close it to clean out our review queue. Please don't hesitate to submit a new PR if you decide to revisit this. Thanks! |
I am the maintainer of the package video_player_media_kit. While working with live streams, I encountered an issue where I needed to update the duration dynamically. However, I realized that there was no existing mechanism to update the duration.
This pull request aims to address this problem by introducing a new event called durationUpdate. This event allows the duration to be updated independently, providing greater flexibility when working with live streams. With this addition, developers will have the ability to send duration updates as needed.
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.