When playing a Youtube video, if you open the player settings pane and the file size of a given video at a given quality is sufficiently large to overflow the 32-bit integer holding the size of the video in bytes, it will report the wrong size. See the example below with the 4k video size being incorrectly listed in the hundreds of MB:
The issue seems to reside within app/src/main/java/com/futo/platformplayer/helpers/VideoHelper.kt, which contains the function (estimateSourceSize) that is used to get a file size estimate in bytes. estimateSourceSize returns an Int rather than a Long, leading to the wrong value being eventually passed into the toHumanBytesSize function in app/src/main/java/com/futo/platformplayer/Extensions_Formatting.kt, which is responsible for reporting the estimated file size in the player settings pane.
I haven't tested this with plugins other than Youtube, but seeing as it is within the core, I would suspect that this would be an issue for other plugins as well.
The issue was tested with:
Grayjay v264
Youtube Plugin v207
This bug should apply to all devices, but it was discovered on a Google Pixel 7a running Android 15 (firmware AP3A.241005.015).
What happened?
When playing a Youtube video, if you open the player settings pane and the file size of a given video at a given quality is sufficiently large to overflow the 32-bit integer holding the size of the video in bytes, it will report the wrong size. See the example below with the 4k video size being incorrectly listed in the hundreds of MB:
The issue seems to reside within app/src/main/java/com/futo/platformplayer/helpers/VideoHelper.kt, which contains the function (estimateSourceSize) that is used to get a file size estimate in bytes. estimateSourceSize returns an Int rather than a Long, leading to the wrong value being eventually passed into the toHumanBytesSize function in app/src/main/java/com/futo/platformplayer/Extensions_Formatting.kt, which is responsible for reporting the estimated file size in the player settings pane.
I haven't tested this with plugins other than Youtube, but seeing as it is within the core, I would suspect that this would be an issue for other plugins as well.
The issue was tested with: Grayjay v264 Youtube Plugin v207
This bug should apply to all devices, but it was discovered on a Google Pixel 7a running Android 15 (firmware AP3A.241005.015).
Grayjay Version
264
What plugins are you seeing the problem on?
Youtube
Plugin Version
207
When do you experience the issue?
Relevant log output
No response