question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Player does not respect Redirection from HTTP response

See original GitHub issue

Describe the bug The stream URL responds with a different ‘Location’ header, it ignores that and tries to stream data from the same domain but with a mangled path.

To reproduce Steps to reproduce the behavior. Utilize a endpoint that returns a Location header pointing to the stream file in a Storage service (e.g. gcp, AWS S3, etc)

Expected behavior The player should load from the proper “new” location (e.g. be redirected) using the Location header data.

Screenshots

The request: Captura de Tela 2022-08-10 às 22 23 50

The location header: Captura de Tela 2022-08-10 às 22 24 03

Expected behavior: Captura de Tela 2022-08-10 às 22 26 25

How it behaves: Captura de Tela 2022-08-10 às 22 27 12

Device (please complete the following information):

  • Simulator or Real Device: Simulator
  • Device: iPhone 13
  • OS: 15.5

Debug logs (Errors bellow are due to the player trying to load the stream from a mangled path):

Error 500:  (MediaPlaylist: ErrorNetwork)
[Error: Request failed with status code 503]

Additional context The expected behaviour comes from a package that I used before called react-native-aws-ivs-player which reacted correctly to the http redirection.

HTTP Response data:

{
  "id": 415401149733227800,
  "requestTime": "2022-08-11T01:30:37.419Z",
  "method": "GET",
  "url": "https://hml-mobile.tradersclub.com.br/tcmediaapi/v1/file/hls/6524ac42-fb1b-4c10-a96a-a2f088448913.m3u8",
  "domain": "hml-mobile.tradersclub.com.br/tcmediaapi/v1/file/hls/6524ac42-fb1b-4c10-a96a-a2f088448913.m3u8",
  "requestHeaders": [
    {
      "value": "application/x-mpegURL, application/vnd.apple.mpegurl, application/json, text/plain",
      "key": "Accept"
    }
  ],
  "responseTime": "2022-08-11T01:30:37.589Z",
  "status": 307,
  "reason": "temporarily redirected",
  "responseHeaders": [
    {
      "value": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400",
      "key": "Alt-Svc"
    },
    {
      "value": "cloudflare",
      "key": "Server"
    },
    {
      "value": "DYNAMIC",
      "key": "cf-cache-status"
    },
    {
      "value": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
      "key": "expect-ct"
    },
    {
      "value": "https://storage.googleapis.com/tc-media-storage-hml/hls/6524ac42-fb1b-4c10-a96a-a2f088448913/6524ac42-fb1b-4c10-a96a-a2f088448913.m3u8",
      "key": "Location"
    },
    {
      "value": "Thu, 11 Aug 2022 01:30:37 GMT",
      "key": "Date"
    },
    {
      "value": "max-age=31536000; includeSubDomains; preload",
      "key": "Strict-Transport-Security"
    },
    {
      "value": "b13ac13f-ad8c-4521-b5ff-54741cdc9c7d",
      "key": "x-request-id"
    },
    {
      "value": "0",
      "key": "Content-Length"
    },
    {
      "value": "2",
      "key": "x-envoy-upstream-service-time"
    },
    {
      "value": "nosniff",
      "key": "x-content-type-options"
    },
    {
      "value": "738d3502eba0a6ac-GRU",
      "key": "cf-ray"
    },
    {
      "value": "Origin",
      "key": "Vary"
    }
  ],
  "responseLength": 0,
  "requestLength": 0,
  "duration": 170
}

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexmdodgecommented, Aug 22, 2022

After some internal investigation, re-labelling as a feature request as we do not support this path with the current wrapper implementation. We’re evaluating where to put this in our roadmap.

0reactions
arthurgeron-workcommented, Sep 16, 2022

@arthurgeron-work to help with our investigation, do you know if the previous package (react-native-aws-ivs-player) that worked for you was a previous version of this repository? Or is it another package on GitHub?

No it wasn’t a previous version of this repository! It was developed by a independent dev that used AWS native player with a React Native Wrapping Layer, this is the link to the repo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Response.Redirect not always redirecting - Stack Overflow
If you click "here," it redirects to the correct page. Any ideas why it would display the 302 message sporadically? http · iis...
Read more >
How To Fix the HTTP 302 Error (5 Methods) - Kinsta
HTTP 302 codes are useful to temporarily redirect website users to another URL. If you're getting this error code, here are 5 ways...
Read more >
Check Your Website's HTTP Response Status | Matthew Edgar
Every page on every website returns a status code. How do you check the status code for your website's pages? What do the...
Read more >
Understand VAST video error codes - Authorized Buyers Help
A video player can trigger some errors, but still play the ad. ... error 102 VAST response version not supported ... error 301...
Read more >
URL Redirects - Squarespace Help Center
This means that there's an error in your redirect type. Only 301 and 302 are accepted here. Check that there are no extra...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found