Skip to content

fix: handle getter-only inBandMetadataTrackDispatchType on native tracks#1606

Open
xxiaoxiong wants to merge 1 commit into
videojs:mainfrom
xxiaoxiong:fix/native-track-dispatch-type
Open

fix: handle getter-only inBandMetadataTrackDispatchType on native tracks#1606
xxiaoxiong wants to merge 1 commit into
videojs:mainfrom
xxiaoxiong:fix/native-track-dispatch-type

Conversation

@xxiaoxiong
Copy link
Copy Markdown

Description

When using nativeTextTracks on Firefox, calling tech.addTextTrack() returns a native TextTrack where inBandMetadataTrackDispatchType is a getter-only property. Attempting to set it throws:

TypeError: setting getter-only property "inBandMetadataTrackDispatchType"

This wraps the assignment in a try-catch to gracefully handle environments where the property is read-only.

Related Issues

Fixes videojs/video.js#8053

References

On browsers with native text tracks (e.g. Firefox), addTextTrack
returns a native TextTrack where inBandMetadataTrackDispatchType is a
getter-only property. Setting it throws a TypeError.

This wraps the assignment in a try-catch to gracefully handle
environments where the property is read-only.

Fixes videojs/video.js#8053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: setting getter-only property "inBandMetadataTrackDispatchType"

1 participant