-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[video_player] Passing http headers to file constructor #6213
[video_player] Passing http headers to file constructor #6213
Conversation
note: onPlayerError in listener override had to be removed so i think its not working and the details that i found from release notes has been added as a comment to help in that matter
…g-httpHeaders-to-file-constructor
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. |
|
||
if (isHTTP(uri)) { |
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.
@zezo357 I am ready to add tests but I have some follow up questions first to make sure I understand the change.
- Why did you delete the check for
isHttp(...)
and usenew DefaultDataSource.Factory(context, httpDataSourceFactory)
by default versushttpDataSourceFactory.setDefaultRequestProperties(httpHeaders)
? What happens if the uri is not HTTP? - As a follow up to (1), was the fix for passing mu38 files to add the
.setUserAgent(httpHeaders.get(USER_AGENT))
line ifUSER_AGENT
is present the HTTP headers?
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.
1-If not http all functions will work and it's the main fix since when playing a m3u8 file it's not http
2- user agent should be added to the http headers If the user wants it (it's needed because some hosts do not allow the default user agent)
Triage checkin: what's the state of this PR? Is it just waiting for tests? |
Waiting on the java native tests since I couldn't implement those, but the dart tests I already implemented and they are passing |
@zezo357 Sorry for the delay on this. Just added tests and made some minor changes. Let me know what you think! |
Will check it thoroughly tomorrow and test it But for now I see it looks good |
looks good to me. |
@zezo357 Can you fix the failing Dart test? Then we'll need a second review. |
will check them |
I fixed the dart test related to my pull request there is another one that fails
|
@zezo357 I don't see that failure, but there is a formatting error, but you can run the command suggested to fix it https://github.com/flutter/plugins/pull/6213/checks?check_run_id=10935748930 |
fixed formatting |
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.
- I listed at least one issue that this PR fixes in the description above.
Please add the issue link to the PR description.
Is this problem actually Android-specific, or does it apply to iOS as well? It's fine to fix it only for Android for now if you don't have iOS experience, but if it's broken there as well we should update the relevant issue accordingly.
i didnt test on ios, but the issue was for me on android. and i did describe the issue on the pull request should i open an issue? |
Yes, that checklist item is about having an issue filed clearly describing the problem, including reproduction steps, so there's a place to reference details about the issue being fixed. |
ok i will open one and try to make the steps to reproduce it. |
i added the issue in the description with example repo due to using packages to retrieve new urls since the urls lifetime is short |
We've just completed the migration of the plugin code to the flutter/packages repository, as described in https://flutter.dev/go/flutter-plugins-repo-migration, and this repository is now being archived. Unfortunately that means that all in-progress PRs here must be moved to flutter/packages. Please see our instructions for an explanation of how to move your PR, and if you have any issues moving your PR please don't hesitate to reach out in the #hackers-ecosystem channel in Discord. Our apologies that your PR was caught in this one-time transition. We're aware that it's disruptive in the short term, and appreciate your help in getting us to a better long-term state! |
when passing m3u8 file to videoplayer as videoplayercontroller.file links insided m3u8 file has to be used with http headers
so i passed it in the videoplayercontroller.file and changed all things related to it
issue flutter/flutter#119467
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to 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.