@@ -385,6 +385,25 @@ goog.requireType('shaka.media.PresentationTimeline');
385
385
*/
386
386
387
387
388
+ /**
389
+ * @event shaka.Player.MetadataAddedEvent
390
+ * @description Triggers when metadata associated with the stream is added.
391
+ * @property {string } type
392
+ * 'metadataadded'
393
+ * @property {number } startTime
394
+ * The time that describes the beginning of the range of the metadata to
395
+ * which the cue applies.
396
+ * @property {?number } endTime
397
+ * The time that describes the end of the range of the metadata to which
398
+ * the cue applies.
399
+ * @property {string } metadataType
400
+ * Type of metadata. Eg: 'org.id3' or 'com.apple.quicktime.HLS'
401
+ * @property {shaka.extern.MetadataFrame } payload
402
+ * The metadata itself
403
+ * @exportDoc
404
+ */
405
+
406
+
388
407
/**
389
408
* @event shaka.Player.MetadataEvent
390
409
* @description Triggers after metadata associated with the stream is found.
@@ -3494,6 +3513,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3494
3513
// JSON stringify produces a good ID in this case.
3495
3514
region . id = JSON . stringify ( region ) ;
3496
3515
this . metadataRegionTimeline_ . addRegion ( region ) ;
3516
+ const data = new Map ( )
3517
+ . set ( 'startTime' , region . startTime )
3518
+ . set ( 'endTime' , region . endTime )
3519
+ . set ( 'metadataType' , region . schemeIdUri )
3520
+ . set ( 'payload' , region . payload ) ;
3521
+ this . dispatchEvent ( shaka . Player . makeEvent_ (
3522
+ shaka . util . FakeEvent . EventName . MetadataAdded , data ) ) ;
3497
3523
}
3498
3524
3499
3525
/**
0 commit comments