Open TheBeastLT opened 2 months ago
This is due to the new subtitle handling using ProgressiveMediaPeriod
rather than SingleSampleMediaPeriod
, and the different implementations of MediaPeriod.prepare
these two classes have.
SingleSampleMediaPeriod
does nothing in its prepare
method:
And only loads data inside continueLoading
(which will only be called after the track has been selected):
Whereas ProgressiveMediaPeriod
, as a general purpose class for playing progressive media files (like MP4), needs to load data in prepare
in order to determine what tracks are available:
I agree this is unexpected, it's an unintended side-effect of using ProgressiveMediaPeriod
.
@icbaker Are there any intentions to change and fix this?
Yes, I'm working on this at the moment.
Version
Media3 1.4.1
More version details
No response
Devices that reproduce the issue
Any device
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
With the version
1.4.1
theexperimentalSetTextTrackTranscodingEnabled
feature is enabled by default and it introduces behaviour that is not expected and was not there before. With it enabled the player loads each and every subtitle configuration that is defined for theMediaItem
even if it is not selected. There can be uses cases where these subtitles configuration are remote urls and there can be many of them for different languages, so loading all of them when initialising the media item is not efficient and introduces delay when the item is played. Ideally only the selected subtitle should be transcoded, as was the behaviour before with remote urls - it would get downloaded only when it was selected.Expected result
Not all subtitle configuration are loaded when
MediaItem
is initializedActual result
All subtitles configuration are loaded (and in case of remote urls - are downloaded)
Media
Any
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.