Closed BartusZak closed 3 years ago
I will try to add headers support by next week.
Hey @balvinderz,
How are you?
Were you able to add those headers?
Thanks for update :)
I am good . I tried adding the headers . but whenever i sent custom headers using hls.js , the preflight request would fail . So i didnt update the plugin. I can push my changes to a separate branch if you want to check if it works for you .
Please do :)
Let me give a try.
Thanks a lot.
pushed my changes to headers branch . Sending headers are only supported in m3u8 files.
Can you make an example web app for the same My use case is
I have a url (hls) with the .m3u8
extension
But to request that file I need to give four custom headers: Origin, Referer, Cookie and User-Agent
Can you have an example or guide me how I could do the same?
You cannt pass Origin, Referer ,User-Agent in headers because they are sent by the browser . For cookie you can pass headers as
headers : { "useCookie" : true }
in VideoPlayerController.network
@BartusZak did you try ?
@balvinderz
I just wanted to let you know that i'm going to take a look at it right now.
I cloned repo and flutter run
to /example
.
Player does not work:
seq-8.ts
,I changed the source to https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8 and retried.
Now it plays. Looks like that is source related issue.
I'm going to investigateheaders
feature and get back to you.
Hey @balvinderz
I was able to create a working sample with calculating different header per request feature. https://github.com/balvinderz/video_player_web_hls/pull/10
The code still requires refactor and removing of sigv4
library I use for calculating headers.
Please let me know If u want me to provide AWS_ACCESS_KEY
and AWS_SECRET_KEY
so you can test it out.
publish video_player_web_hls: 0.1.10 which has support for passing headers . Thank you @BartusZak for your help .
Hey @balvinderz
I was able to create a working sample with calculating different header per request feature. #10
The code still requires refactor and removing of
sigv4
library I use for calculating headers.Please let me know If u want me to provide
AWS_ACCESS_KEY
andAWS_SECRET_KEY
so you can test it out.Google Dev Tools Network Tab
@BartusZak I am using the video_player_web_hls on top of flick_video_player to play .m3u8 videos in my flutter web app. the plugin works fine for normal .m3u8 URLs but when I am trying to implement AWS signed cookies for web and pass cookies in the header. It gives me the 403 error.
Can you please help me out if it something wrong implemented from my side or its problem from the plugin side?
@mrinaljain did you manage to solve this issue somehow? Stuck on this issue now and looking for solutions
Pass useCookies as true in headers.
Unfortunately, that doesn't seem to work for me. starting a new issue
Hey @balvinderz,
video_player
allows now to add http headers to request. (https://github.com/flutter/plugins/pull/3671)Do you plan to implement that feature to allow to access secured
.aac
files directly from storage?In my case I store
.aac
files in securedAmazon S3 Bucket
. I have to be able to calculate separate HTTPS tokens for every.aac
file just before I fetch them.Thanks!