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

Player does not respect Redirection from HTTP response #84

Open
arthurgeron-work opened this issue Aug 11, 2022 · 5 comments
Open

Player does not respect Redirection from HTTP response #84

arthurgeron-work opened this issue Aug 11, 2022 · 5 comments

Comments

@arthurgeron-work
Copy link

arthurgeron-work commented Aug 11, 2022

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
}
@arthurgeron-work arthurgeron-work added the bug Something isn't working label Aug 11, 2022
@arthurgeron-work
Copy link
Author

We fixed this by adjusting our transcoder in the back end, not sure if everyone agrees that the player should respect redirection or not so I'll leave this open.

@maxstoller
Copy link
Contributor

Hi @arthurgeron-work, thanks for reporting. We will discuss this behavior internally. Glad you were able to figure out a workaround in the meantime.

@alexmdodge
Copy link
Contributor

@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?

@alexmdodge
Copy link
Contributor

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.

@alexmdodge alexmdodge added feature-request and removed bug Something isn't working labels Aug 22, 2022
@arthurgeron-work
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants