@omnimedia/omnitool 1.1.0-29 → 1.1.0-30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnimedia/omnitool",
3
- "version": "1.1.0-29",
3
+ "version": "1.1.0-30",
4
4
  "description": "open source video processing tools",
5
5
  "license": "MIT",
6
6
  "author": "Przemysław Gałęzki",
@@ -80,5 +80,15 @@ export class VideoPlayer {
80
80
  setFPS(value: number) {
81
81
  this.#controller.setFPS(value)
82
82
  }
83
+
84
+ /**
85
+ call this whenever your timeline state changes
86
+ */
87
+ async update(timeline: TimelineFile) {
88
+ const rootItem = new Map(timeline.items.map(i => [i.id, i])).get(timeline.rootId)!
89
+ const items = new Map(timeline.items.map(i => [i.id, i]))
90
+ this.root = await buildHTMLNodeTree(rootItem, items, this.sampler)
91
+ await this.seek(this.currentTime())
92
+ }
83
93
  }
84
94