streaming-video-technology-alliance / common-media-library

A common library for media playback in JavaScript
Other
43 stars 2 forks source link

fix: Declare isArrayBufferView as native Node.js function to resolve module import error #81

Closed hernanr99 closed 8 months ago

hernanr99 commented 8 months ago

Description

This pull request addresses a module import error encountered when installing the library in a project. The error manifested as follows:

[!] RollupError: "util/types" is imported by "node_modules/@svta/common-media-library/dist/id3/util/utf8.js", but could not be resolved – treating it as an external dependency. https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency node_modules/@svta/common-media-library/dist/id3/util/utf8.js

The underlying cause was the dependency on isArrayBufferView in the util/types module of Node.js. To resolve this issue and avoid future conflicts with direct imports of Node.js modules, we decided to declare isArrayBufferView as a native function, thus eliminating the need to import it directly from util/types.

This change implements isArrayBufferView as an auxiliary function in the code, ensuring that the previous functionality remains intact while resolving the module import error.

Requirements Checklist