Fix: Initialize 'audio_details' and 'video_details' properties and update codecData documentation #1301
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When uploading a video without audio, the 'data' parameter passed to the callback function in the codecData event is as follows.
As shown in the example above, the 'audio' property is initialized as an empty string. However, upon examining the original code, we notice an inconsistency: while the 'audio' property is initialized with an empty string, the 'audio_details' property is not initialized at all. This situation presents two issues:
These inconsistencies can lead to confusion among developers and may cause unexpected errors during type checking. Furthermore, it creates a mismatch between the actual implementation and the type definitions, potentially leading to runtime errors that are not caught during development.
Therefore, I have added an initialization statement for audio_details as follows
Add duration property to codecData JSDoc
Remove unused varibales