Skip to content

When playing HLS, cannot read properties of null (reading 'startTime') #7427

@Wchvan

Description

@Wchvan

Have you read the FAQ and checked for duplicate open issues?
Yes

If the problem is related to FairPlay, have you read the tutorial?

Not related to FairPlay.

What version of Shaka Player are you using?

4.9.3

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?
Yes

Are you using the demo app or your own custom app?
My own custom app

If custom app, can you reproduce the issue using our demo app?
Haven't been able to run the demo app yet.

What browser and OS are you using?
MacOS Sonoma 14.4.1 Google Chrome

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
N/A

What are the manifest and license server URIs?

Not able to share

What configuration are you using? What is the output of player.getConfiguration()?

default

What did you do?

  1. Call player.load(url, 0) with url to be like https://www.xyz.com/test.m3u8
  2. In a super bad network condition with high latency and slow speed
  3. throw error {"stack":"TypeError: Cannot read properties of null (reading 'startTime') (../../../../../../node_modules/shaka-player/lib/hls/hls_parser.js:495:42)

What did you expect to happen?
Properly handle audio streams in m3u8 format - hls

What actually happened?

related log

2024-10-11_12:00:10.93834-0700 [2:2:1011/120010.938274:INFO:CONSOLE(1)] "[XXX] [sendPlaybackError] PlayerErrorUnspecifiedError {"stack":"TypeError: Cannot read properties of null (reading 'startTime')    at S1.h (***/_app/immutable/chunks/shaka-player.compiled-728d6550.js:33:5121)    at fo (***/_app/immutable/chunks/shaka-player.compiled-728d6550.js:6:3739)    at A1.next (***/_app/immutable/chunks/shaka-player.compiled-728d6550.js:6:4037)    at t (***/_app/immutable/chunks/shaka-player.compiled-728d6550.js:6:4266)","message":"Cannot read properties of null (reading 'startTime')","severity":1}", source: ***/_app/immutable/chunks/log-8cc35343.js (1)

related code

# lib/hls/hls_parser.js
async updateStream_(streamInfo) {
...
    const {segments, bandwidth} = this.createSegments_(        playlist, stream, mediaSequenceToStartTime, mediaVariables,        streamInfo.getUris, streamInfo.type);
...    
    const oldSegment = segments[0];
    goog.asserts.assert(oldSegment, 'Should have segments!');
    streamInfo.minTimestamp = oldSegment.startTime; // startTime undefined
...
}

createSegments_(playlist, stream, mediaSequenceToStartTime, variables,      getUris, type) {....} 

Are you planning send a PR to fix it?
Not yet, seek for help to see if there is a good way to fix it

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: archivedArchived and locked; will not be updatedtype: bugSomething isn't working correctly

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions