RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
226 stars 28 forks source link

Set custom http headers for Exoplayer #523

Closed kenneth-ox closed 3 years ago

kenneth-ox commented 3 years ago

Describe the bug We are trying to use pre-signed cookies for AWS CloudFront. We have to set custom headers to AVPro exoplayer through PlatformOptionsAndroid.httpHeaders.Add(new MediaPlayer.PlatformOptions.HTTPHeader("Cookie", "CloudFront-Policy=XX;CloudFront-Key-Pair-Id="XXX";CloudFront-Signature="YYYY")) But it did not work and failed to load the HLS playlist. The logs showed something like "failed to load asset" "[AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources." From this thread, https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/210, 1.10.2 seems to work. Is there a way that we can get this package?

Your Setup (please complete the following information):

Logs If applicable, add error logs to help explain your problem.

Screenshots If applicable, add screenshots to help explain your problem.

Videos If applicable, add a copy of your video or the URL

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us unitysupport@renderheads.com

Ste-RH commented 3 years ago

I am sure we could sort you out with an older package, but I would much rather investigate why you are seeing this issue and fix it. Would it be possible to send over an example URL/header so we can reproduce it here? If you would rather not make this public then you can email it over to unitysupport@renderheads.com

kenneth-ox commented 3 years ago

Hi Ste Butcher,

I am sorry we cannot give out the actual urls we use for development. But we can give out the sample hls asset folder. https://drive.google.com/file/d/1mpGntPSQUFhBrVeAKTs0YJ8hORzOQ6ZQ/view?usp=sharing In order to exactly reproduce the problem, you need access to AWS and put the hls folder on an S3 bucket, generate cloudfront pre-signed cookies to secure them following the tutorial below. https://www.youtube.com/watch?v=iw-OtY5_A0w May I also ask about the issue of HLS being played only at the lowest resolution for unity exoplayer? The ticket below said it will be fixed in 2.0. May I ask when it will be released on Unity? https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/35

Thanks, Kenneth

On Thu, Nov 19, 2020 at 6:43 PM Ste Butcher notifications@github.com wrote:

I am sure we could sort you out with an older package, but I would much rather investigate why you are seeing this issue and fix it. Would it be possible to send over an example URL/header so we can reproduce it here? If you would rather not make this public then you can email it over to unitysupport@renderheads.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/523#issuecomment-730286787, or unsubscribe https://github.com/notifications/unsubscribe-auth/AONS4CHLWIAMKD3ANFHWHWTSQTZERANCNFSM4TW6E4QQ .

kenneth-ox commented 3 years ago

Hi Kenneth, We are aiming to release version 2 to the Unity store before Christmas. In version 2 we have added an option to hint to the player to start at the highest bitrate for streams. Best,Ste On Wed, 25 Nov 2020 at 10:21

Ste-RH commented 3 years ago

It appears something changed in AWS that has caused this to stop working in v1 of AVPro Video. This has been fixed for v2 due to changes to the core of ExoPlayer. Unfortunately we will not be offering a fix for v1.