@uimaxbai/am-lyrics 1.5.2 → 1.5.3

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/dist/src/react.js CHANGED
@@ -322,7 +322,7 @@ class GoogleService {
322
322
  }
323
323
  }
324
324
 
325
- const VERSION = '1.5.2';
325
+ const VERSION = '1.5.3';
326
326
  const INSTRUMENTAL_THRESHOLD_MS = 7000; // Show dots for gaps >= 7s
327
327
  const FETCH_TIMEOUT_MS = 8000; // Timeout for all lyrics fetch requests
328
328
  const SEEK_THRESHOLD_MS = 500;
@@ -583,6 +583,28 @@ let AmLyrics$1 = class AmLyrics extends i {
583
583
  this.hasFetchedAllProviders = false;
584
584
  this._updateFooter();
585
585
  try {
586
+ if (this.ttml) {
587
+ const parseResult = AmLyrics.parseTTML(this.ttml);
588
+ if (parseResult && parseResult.lines.length > 0) {
589
+ this.lyrics = parseResult.lines;
590
+ this.lyricsSource = 'Local';
591
+ if (parseResult.songwriters) {
592
+ this.songwriters = parseResult.songwriters;
593
+ }
594
+ this.availableSources = [
595
+ {
596
+ lines: this.lyrics,
597
+ source: 'Local',
598
+ songwriters: this.songwriters,
599
+ },
600
+ ];
601
+ this.currentSourceIndex = 0;
602
+ this.hasFetchedAllProviders = true;
603
+ this._updateFooter();
604
+ await this.onLyricsLoaded();
605
+ return;
606
+ }
607
+ }
586
608
  const resolvedMetadata = await this.resolveSongMetadata();
587
609
  // If a newer fetch was triggered while we awaited, bail out
588
610
  if (controller.signal.aborted)
@@ -2185,6 +2207,7 @@ let AmLyrics$1 = class AmLyrics extends i {
2185
2207
  if ((changedProperties.has('query') ||
2186
2208
  changedProperties.has('musicId') ||
2187
2209
  changedProperties.has('isrc') ||
2210
+ changedProperties.has('ttml') ||
2188
2211
  changedProperties.has('songTitle') ||
2189
2212
  changedProperties.has('songArtist') ||
2190
2213
  changedProperties.has('songAlbum') ||
@@ -5860,6 +5883,9 @@ __decorate([
5860
5883
  __decorate([
5861
5884
  n({ type: String })
5862
5885
  ], AmLyrics$1.prototype, "isrc", void 0);
5886
+ __decorate([
5887
+ n({ type: String })
5888
+ ], AmLyrics$1.prototype, "ttml", void 0);
5863
5889
  __decorate([
5864
5890
  n({ type: String, attribute: 'song-title' })
5865
5891
  ], AmLyrics$1.prototype, "songTitle", void 0);