-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Description
We are using video js player to stream content from media live. Using below code to insert id3 metadata tag into media live frames.
const client = new MediaLiveClient({ region: "us-east-1" });
let channelId = "XXXXXX";
const command = new BatchUpdateScheduleCommand({
ChannelId: channelId,
Creates: {
ScheduleActions: [
{
ActionName: `id3tag_${Date.now()}`,
ScheduleActionStartSettings: {
ImmediateModeScheduleActionStartSettings: {}
},
ScheduleActionSettings: {
HlsId3SegmentTaggingSettings: {
Tag: "SLIDE=44"
}
}
}
]
}
});
try {
const response = await client.send(command);
console.log("Metadata inserted:", response);
return response;
} catch (error) {
console.error("Failed to insert metadata:", error);
throw error;
}
And on client-side angular consuming the tag with the following code.
this.player.on('loadedmetadata', () => {
console.log('📺 Video data loaded');
const tracks = this.player.textTracks();
console.log('🎬 Available text tracks:', tracks);
for (let i = 0; i < tracks.length; i++) {
const track = tracks[i];
console.log(`Track ${i}: kind=${track.kind}, label=${track.label}`);
if (track.kind === 'metadata' && track.label === 'Timed Metadata') {
track.mode = 'hidden';
track.addEventListener('cuechange', () => {
if (track.activeCues && track.activeCues.length > 0) {
for (let j = 0; j < track.activeCues.length; j++) {
const cue: any = track.activeCues[j];
console.log("🎯 ID3 Metadata Cue:", cue);
const data = track.activeCues[j].value.data;
console.log('DATA', data);
}
}
});
}
}
});
Even though we are receiving metadata but below are the errors which are in console. Any idea how to fix it.

TypeError: Failed to set the 'endTime' property on 'TextTrackCue': The provided double value is non-finite. at video.es.js:43864:18 at Array.forEach (<anonymous>) at video.es.js:43863:14 at Array.forEach (<anonymous>) at addMetadata (video.es.js:43859:20) at SegmentLoader.handleId3_ (video.es.js:45952:5) at onId3 (video.es.js:42297:9) at Worker.handleMessage [as __zone_symbol__ON_PROPERTYmessage] (video.es.js:41749:7) at Worker.wrapFn (zone.js:778:39) at _ZoneDelegate.invokeTask (zone.js:402:33)