muxinc / mux-stats-sdk-react-native-video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Upscale and downscale % metrics no longer blocked by RN bug

Waltari10 opened this issue · comments

commented

In the readme.md caveats it states that upscale and downscale % metrics couldn't be calculated because can't get width and height from HLS format. It links to an issue stating that it's open, but it has been closed some time ago. Link to issue: TheWidlarzGroup/react-native-video#1194. Fixed by: TheWidlarzGroup/react-native-video#1992

Could we now have support for upscale and downscale metrics as that issue has been fixed? :)

Hey @Waltari10 - thanks for bringing this to our attention! We took a quick look at this, and while it's a step in the right direction, I'm not sure that it will fully resolve this issue for us. In order for Mux to track upscaling/downscaling, we need to be able to interrogate the player and video size (height and width) throughout the whole of playback.

With HLS, the video size can change as different renditions are selected. From what I see of this change, it looks like react-native-video may only be storing the source resolution when a new player item is loaded/ready - https://github.com/react-native-video/react-native-video/pull/1992/files#diff-9ca9c62c4df28839b6a39c52207fa8885bf25dd0ea662635fc318bf0219ed11fL616. If that's the case, then we won't be able to tell the source size as it changes through playback, which would result in inaccurate metrics for upscaling/downscaling.

We will take a pass to see if this is actually the case or not, but in the meantime, do you happen to know yourself if react-native-video will report the changing source resolution throughout playback?

commented

I think you're right that react-native-video doesn't report the source resolution when the quality changes. At least couldn't find any callback or ref. So yeah, looks like would have to first expand react-native-video somehow :/