Skip to content
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 plugin - Support HTTP headers #16466

Closed
cbenhagen opened this issue Apr 11, 2018 · 38 comments · Fixed by flutter/plugins#3671
Closed

Video Player plugin - Support HTTP headers #16466

cbenhagen opened this issue Apr 11, 2018 · 38 comments · Fixed by flutter/plugins#3671
Labels
a: video Video playback c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter customer: crowd Affects or could affect many people, though not necessarily a specific customer. p: video_player The Video Player plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels.

Comments

@cbenhagen
Copy link
Contributor

It would be nice to add support for HTTP headers:

new VideoPlayerController.network("https://example.com/test.mp4",
    headers: {HttpHeaders.AUTHORIZATION: "Basic your_api_token_here"}
)
@freewheelnat
Copy link

Agreed, it would allow us to use the plugin to show videos hosted on our servers (for which we need Authorization header).

@charafau
Copy link
Contributor

I can volunteer to implement that..

@cbenhagen
Copy link
Contributor Author

@charafau any news on this?

@charafau
Copy link
Contributor

charafau commented Apr 22, 2018

sorry didn't have much time over the week, I got working android implementation, give me some time to get around with objc and ios - I will do this this week.

@Hixie Hixie added the a: video Video playback label Apr 25, 2018
@freewheelnat
Copy link

Any update on this? It's becoming quite critical for my app, but I only need the Android implementation for now, so trying to figure out how to proceed.

@cbenhagen
Copy link
Contributor Author

For mine as well. @charafau may I suggest to open a WIP pull request with what you have got? This way others might help with what is missing or review what is already there.

@charafau
Copy link
Contributor

charafau commented May 4, 2018

@freewheelnat @cbenhagen sorry about keeping you wait, headers on ios seems more complicated than I thought. I created WIP for android

@freewheelnat
Copy link

FYI, I have found a workaround for my use case, as the url I call for the video accept the https://username:password@url format for authentication, so I don't need to send an authorisation header.

@cbenhagen
Copy link
Contributor Author

Unfortunately this does not work for us.

@viju85
Copy link

viju85 commented Nov 9, 2018

Same here. Is there any update on adding headers support?

@charafau
Copy link
Contributor

I must say I failed to implement this for iOS, you'd have to change how current plugin works (or worked at that time)

@cbenhagen
Copy link
Contributor Author

There are two PR trying to fix this issue but on iOS both use a private API (AVURLAssetHTTPHeaderFieldsKey). I wonder if that would really get an app rejected. Is there someone on here with good contacts to Apple which could get this approach approved?

@Yarikk26
Copy link

Our app has been approved by Apple with this fix without a problem.

@pepie
Copy link

pepie commented Feb 28, 2019

Hello. Has there been any progress on this?
I can definitely use a solution for this.

@JohnGalt1717

This comment was marked as abuse.

@morchidnb
Copy link

Hello, any progress in this, it will be very useful ??

@Appli-chic
Copy link

Any news about it?

@JarvanMo
Copy link

@sc4v3ng3r
Copy link

sc4v3ng3r commented Nov 12, 2019

Please add support to http headers. It's a crucial setting.

@TRUSTMEIMJEDI
Copy link

Are there any news about merging it to the master need this functionality for my engineer thesis ASAP ?

@Ladriel
Copy link

Ladriel commented Nov 18, 2019

I second that idea, it would be really handy.

@alibt
Copy link

alibt commented Jan 2, 2020

i have same issue. any news?

@cherlow
Copy link

cherlow commented Jan 14, 2020

any update on this issue?

@Yarikk26
Copy link

The proposed solutions use private iOS API. I heard that Apple started rejecting applications based on Electron for this reason. I don't think that they would take a risk to get such a solution merged in master.

@cherlow
Copy link

cherlow commented Jan 14, 2020

The proposed solutions use private iOS API. I heard that Apple started rejecting applications based on Electron for this reason. I don't think that they would take a risk to get such a solution merged in master.

do you have a workaround for android only...i need it urgently

@VladyslavBondarenko VladyslavBondarenko added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Mar 17, 2020
@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@jaysephjw
Copy link

jaysephjw commented Jul 16, 2020

Since supporting arbitrary headers currently seems blocked because of the private iOS API, I have created a separate issue (#61638) and PR (flutter/plugins#2882) for supporting Cookies only as a workaround 🤞

So, won't help if you need an "Authorization" header but will help if you need to attach a session cookie.

@JohnGalt1717

This comment was marked as abuse.

@Hixie Hixie removed this from the None. milestone Aug 17, 2020
@AhmedNourJamalElDin
Copy link

Any update?

@pedromassangocode pedromassangocode added passed first triage c: proposal A detailed proposal for a change to Flutter labels Mar 2, 2021
stuartmorgan pushed a commit to flutter/plugins that referenced this issue Mar 25, 2021
This enables to pass HTTP headers to VideoPlayerController.network.

Fixes: flutter/flutter#16466
@jhancock4d
Copy link

This appears to not be working for web despite jsplayer fully supporting it.

@github-actions
Copy link

github-actions bot commented Aug 2, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
zhouyuanbo pushed a commit to zhouyuanbo/video_player_2.6.1 that referenced this issue Jun 1, 2023
This enables to pass HTTP headers to VideoPlayerController.network.

Fixes: flutter/flutter#16466
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: video Video playback c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter customer: crowd Affects or could affect many people, though not necessarily a specific customer. p: video_player The Video Player plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.