Until now all emitted events have been plain javascript objects. The new MetaData*Received events all are emitted as arrays. This causes issues with the useTrackPlayerEvents hook, since it adds a type property on to the received event object, in order to allow distinguishing the event types from each other (since you can subscribe to multiple events in one go).
Because the MetaData*Received events are arrays, this causes the way they are serialized to JSON te become:
modify the useTrackPlayerEvents hook to call the callback with { type: string; payload: event-object-or-array }
modify the value emitted through Event.MetadataChapterReceived, Event.MetadataTimedReceived, Event.MetadataCommonReceived to be something like { metadata: array-of-metadatas }
Until now all emitted events have been plain javascript objects. The new
MetaData*Received
events all are emitted as arrays. This causes issues with theuseTrackPlayerEvents
hook, since it adds atype
property on to the received event object, in order to allow distinguishing the event types from each other (since you can subscribe to multiple events in one go).Because the
MetaData*Received
events are arrays, this causes the way they are serialized to JSON te become:A few ways we could solve this situation:
useTrackPlayerEvents
hook to call the callback with{ type: string; payload: event-object-or-array }
Event.MetadataChapterReceived
,Event.MetadataTimedReceived
,Event.MetadataCommonReceived
to be something like{ metadata: array-of-metadatas }