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

HLS naturalSize provided no information. #1194

Closed
b1acKr0se opened this issue Aug 23, 2018 · 10 comments
Closed

HLS naturalSize provided no information. #1194

b1acKr0se opened this issue Aug 23, 2018 · 10 comments

Comments

@b1acKr0se
Copy link

b1acKr0se commented Aug 23, 2018

Current behavior

naturalSize from onLoad does not return any information for HLS video.

naturalSize {
    height: "undefined"
    orientation: "undefined"
    width: "undefined"
}

Reproduction steps

Play whatever HLS url and set an onLoad handler.

Expected behavior

Return appropriate width, height and orientation of video (maybe getting from manifest?)

Platform

Which player are you experiencing the problem on:

  • iOS
  • Android ExoPlayer

Video sample

https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8

@astraeapark
Copy link

astraeapark commented Nov 19, 2018

I have same problem

@namgk
Copy link

namgk commented Dec 16, 2018

same here

@smartinsantos
Copy link

same problem here, any word on this?

@jaylecn
Copy link

jaylecn commented Apr 11, 2019

same problem

@ntnahn
Copy link

ntnahn commented May 7, 2019

I have same problem. Is it solved?

@kic83
Copy link

kic83 commented Jul 3, 2019

Any progress?

@ram95krishh
Copy link

image
Same issue. Any updates or workaround on this?

@ming436534
Copy link

I fixed this issue and created a merge request.

@dylanjha
Copy link

dylanjha commented Mar 7, 2020

@ming436534 I just noticed this too. Thanks for including the patch in #1933. I hope to see that get merged.

Two things I'm trying to work through, perhaps someone here could shed some light:

  1. I'm wondering, what happens when there is a rendition change. The naturalSize of the video source would change, would you expect the onLoad callback to fire on every rendition change? Or would you get the new naturalSize through another method?
  2. Is there a way to get the width and height of the player?

The reason I'm asking about (2) is to calculate upscale/downscale metrics. I would like to get the player width/height and compare that to the source width/height. And be able to calculate this dynamically through rendition changes.

Any help in the right direction would be appreciated.

@erikpena
Copy link

Hey @dylanjha,
I'm not sure about 1). It would seem to me that onLoad only gets called on first load (someone please check me on this). I poked around and cannot find an event for when renditions change (along with any details we can get like dimensions). This would be helpful though so that things can be reflected in the UI and app logic.

For 2), you should be able to use the onLayout event (https://reactnative.dev/docs/view#onlayout).

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

No branches or pull requests