Skip to content

Make timeout for opening IndexedDB configurable #8355

@loicraux

Description

@loicraux

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

Is your feature request related to a problem? Please describe.

We have an Electron application for downloading films and watching them offline, which uses shaka-player and its offline storage.

I've noticed in our users' application logs an increasing number of INDEXED_DB_INIT_TIMED_OUT errors (code 9017), which occur when window.indexedDB.open takes more than 5 seconds to call the onsuccess callback.

This 5-second timeout is hardcoded in the shaka-player code. It had already been increased from 2 seconds to 5 seconds by this Pull Request: #4984

It seems established that the performance of window.indexedDB.open is proportional to the size of the DB and the tables that need to be loaded (and probably also impacted by the performance of the user's machine). See for example this source.

I think that users encounter this error due to a combination of a large number of films downloaded and the lower performance of their machine.

Describe the solution you'd like

I think it would be a good idea to be able to set the value of this timeout in the shaka-player configuration. It would be optional in the configuration, with a default value of 5 seconds.

It would also be desirable to be able to deactivate this timeout completely. In this case it would be set to false in the shaka-player configuration.

Describe alternatives you've considered

No alternative solution considered.

Additional context

N/A

Are you planning to send a PR to add it?

It looks as a fairly easy PR, so yes I could send one to add this feature.

Metadata

Metadata

Assignees

Labels

component: offlineThe issue involves the offline storage system of Shaka Playerpriority: P3Useful but not urgentstatus: archivedArchived and locked; will not be updatedtype: enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions