Document motion photo imageDurationMs changes

Added documentation and release notes for using `imageDurationMs` to determine image asset loading in `DefaultAssetLoaderFactory`.

PiperOrigin-RevId: 756228166
This commit is contained in:
shahddaghash 2025-05-08 02:55:29 -07:00 committed by Copybara-Service
parent f5ff9672e2
commit 30f645e073
2 changed files with 5 additions and 0 deletions

View File

@ -23,6 +23,8 @@
`EditedMediaItemSequence.Builder`. If the gap is in the middle of the
sequence, then this flag is not required.
* Move `Muxer` interface from `media3-transformer` to `media3-muxer`.
* Make setting `MediaItem.Builder().setImageDuration(long)` mandatory to
import a media item as an image.
* Track Selection:
* Extractors:
* MP3: Use duration and data size from unseekable Xing, VBRI and similar

View File

@ -191,6 +191,9 @@ public final class DefaultAssetLoaderFactory implements AssetLoader.Factory {
MediaItem mediaItem = editedMediaItem.mediaItem;
if (isImage(context, mediaItem)
&& checkNotNull(mediaItem.localConfiguration).imageDurationMs != C.TIME_UNSET) {
// Checks that mediaItem.localConfiguration.imageDurationMs is explicitly set.
// This is particularly important for motion photos, where setting imageDurationMs ensures
// that the motion photo is handled as an image.
if (imageAssetLoaderFactory == null) {
imageAssetLoaderFactory = new ImageAssetLoader.Factory(context, bitmapLoader);
}