Skip to content

standardize events

Compare
Choose a tag to compare
@leandromoreira leandromoreira released this 25 Nov 13:40
· 9846 commits to main since this release
  • fixes (partially) hd indicator not showing up #682
  • standardize progress, timeupdate, loadedmetadada and playbackstate events

Changes to event API

-    this.trigger(Events.PLAYBACK_PLAYBACKSTATE)
+    this.trigger(Events.PLAYBACK_PLAYBACKSTATE, {type: this.playbackType})

-    this.trigger(Events.PLAYBACK_LOADEDMETADATA, duration, loadmetrics)
+    this.trigger(Events.PLAYBACK_LOADEDMETADATA, {duration: duration, data: loadmetrics})

-    this.trigger(Events.PLAYBACK_TIMEUPDATE, position, duration, this.name)
+    this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: position, total: duration}, this.name)

-      this.trigger(Events.PLAYBACK_PROGRESS, 0, this.el.getBytesLoaded(), this.el.getBytesTotal(), this.name)
+      this.trigger(Events.PLAYBACK_PROGRESS,{
+        start: 0,
+        current: this.el.getBytesLoaded(),
+        total: this.el.getBytesTotal()
+      })