Skip to content

HLS stream parsing failing with invalid date format #2929

Description

@mtinnes

Version

Media3 1.8.0

More version details

We are using an Kiloview E3 video encoder for streaming HLS and are encountering the following error:

From what I can tell the date string provided by the encoder is missing the minutes from the time zone offset of the ISO8601 date string. Is it possible to relax the matching on XS_DATE_TIME_PATTERN in order to allow missing minutes and default to 0 when missing?

Playback error (Explain with AI)
  androidx.media3.exoplayer.ExoPlaybackException: Source error
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:937)
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:907)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:223)
      at android.os.HandlerThread.run(HandlerThread.java:67)
  Caused by: androidx.media3.common.ParserException: Invalid date/time format: 2025-12-04T14:00:07.736386-06 {contentIsMalformed=true, dataType=1}
      at androidx.media3.common.util.Util.parseXsDateTime(Util.java:1728)
      at androidx.media3.exoplayer.hls.playlist.HlsPlaylistParser.parseMediaPlaylist(HlsPlaylistParser.java:969)
      at androidx.media3.exoplayer.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:352)
      at androidx.media3.exoplayer.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:75)
      at androidx.media3.exoplayer.upstream.ParsingLoadable.load(ParsingLoadable.java:185)
      at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:453)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
      at java.lang.Thread.run(Thread.java:923)
MediaPlayer error occurred. What: 3001, Extra: 0

Devices that reproduce the issue

Amazon Signage Stick

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps

Create HLS content source using the HlsMediaSource factory with fromUrl() pointing to the stream provided by the E3 encoder.

                mediaSource = new HlsMediaSource.Factory(dataSourceFactory)
                        .createMediaSource(MediaItem.fromUri(uri));

Expected result

HLS stream should function without requiring minutes provided in the ISO8601 date string if stream provider does not include it.

Actual result

Playback failed to initialize with: MediaPlayer error occurred. What: 3001, Extra: 0

Media

HLS stream specifically as provided by the KiloView E3.

Bug Report

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions